Sometimes we have another editor somewhere else instead of TinyMCE (Wordpress Default Editor). That happen when we are creating our own Theme, Plugin or something specific; and we need to write and manipulate a type of post and save it into our WP Database.
So, if you are on that situation, you can...
Before reading and writing text files you should know what encoding to use. See the Perl Unicode Documentation for more details on encoding. Here we show the setting of UTF-8 as the default encoding and decoding for the function open. This is done by using the open pragma near the top of your code (...
HTML Import caching will sometimes mean that changes made to HTML files that get imported do not get reflected upon browser refresh. Take the following import as an example:
<link rel="import" href="./my-element.html">
If a change is done to my-element.html after previo...
The NodeIterator interface provides methods for iterating over nodes in a DOM tree.
Given a document like this one:
<html>
<body>
<section class="main">
<ul>
<li>List Item</li>
<li>List Item</li>
<li>Li...
Modern browsers provide a classList object to ease manipulation of the element's class attribute. Older browsers require direct manipulation of the element's className property.
* Note class names are not stored in the element's property in any particular order
W3C DOM4
Removing one class from an...
Modern browsers provide a classList object to ease manipulation of the element's class attribute. Older browsers require direct manipulation of the element's className property.
* Note class names are not stored in the element's property in any particular order
W3C DOM4
Testing if an element cont...
In MySQL and other SQL dialects, NULL values have special properties.
Consider the following table containing job applicants, the companies they worked for, and the date they left the company. NULL indicates that an applicant still works at the company:
CREATE TABLE example
(`applicant_id` INT, `...
SELECT 1,22,44
UNION
SELECT 2,33,55
SELECT 1,22,44
UNION
SELECT 2,33,55
UNION
SELECT 2,33,55
The result is the same as above.
use UNION ALL
when
SELECT 1,22,44
UNION
SELECT 2,33,55
UNION ALL
SELECT 2,33,55
In InnoDB, having a long PRIMARY KEY (either a single column with a
lengthy value, or several columns that form a long composite value)
wastes a lot of disk space. The primary key value for a row is duplicated in all the secondary index records that point to the same
row. Create an AUTO_INCREME...
The correct invocation of helper modules and functions can be intimidating because
these are generated dynamically (e.g., when creating a new project or adding a new resource)
they are not documented explicitly (e.g., MyApp.ErrorHelpers.error_tag)
the documentation does not cover all examples (...
To automatically reload vimrc upon save, add the following to your vimrc:
if has('autocmd') " ignore this section if your vim does not support autocommands
augroup reload_vimrc
autocmd!
autocmd! BufWritePost $MYVIMRC,$MYGVIMRC nested source %
augroup END
endif
a...
To integrate Siri capabilities in your app, you should add an extensions as you would do while creating an iOS 10 Widget (old Today View Extension) or a custom keyboard.
Adding capability
1- In the project settings, select your iOS app target and go to Capabilities tab
2- Enable the Siri capabili...
Method 1:
proc sql;
create table foo like sashelp.class;
quit;
Method 2:
proc sql;
create table bar as
select * from sashelp.class (obs=0);
quit;
Method 1 should be the preferred option
Importing the framework
Swift
import Contacts
Objective-C
#import <Contacts/Contacts.h>
Checking accessibility
Swift
switch CNContactStore.authorizationStatusForEntityType(CNEntityType.Contacts){
case .Authorized: //access contacts
case .Denied, .NotDetermined: //request permissio...
Applying a filter
To access contacts, we should apply a filter of type NSPredicate to our contactStore variable which we defined it in Authorizing Contact Access example. For example, here we want to sort out contacts with name matching with our own:
Swift
let predicate = CNContact.predicateForCo...
Here is an example of a pipeline script that builds a Docker container, then runs the tests inside of it. The entrypoint is assumed to be either manage.py or invoke/fabric with a runtests command available.
#!/usr/bin/groovy
node {
stage 'Checkout'
checkout scm
sh 'git submodule update ...
The push notification plugin requires an init an initialization which tells the plugin to start running using the sender id provided.
let push = Push.init({
android: {
senderID: "------------",
},
ios: {
alert: "true",
badge: tru...