This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"block":"Basic Latin", | |
"range":"0000-007F", | |
"low":"0000", | |
"high":"007F" | |
}, | |
{ | |
"block":"Latin-1 Supplement", | |
"range":"0080-00FF", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// shorthand helpers | |
export const html = document.documentElement; | |
export const body = document.body; | |
export const el = (e, p = document) => p.querySelector(e); | |
export const els = (e, p = document) => Array.prototype.slice.call(p.querySelectorAll(e)); | |
export const onLoad = cb => document.addEventListener('DOMContentLoaded', cb, false); | |
export const isArray = obj => (Object.prototype.toString.call(obj).toLowerCase().indexOf('array') >= 0); | |
export const isArrayLike = obj => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package Any_Rest | |
* @version 1.7 | |
*/ | |
/* | |
Plugin Name: Any Rest | |
Description: Get any page by slug | |
Usage: http://test1.localhost/wp-json/anyrest/v2/apt?slug=hello-world |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Single Component helper | |
*/ | |
import $ from 'jquery'; | |
import Emitter from './Events'; | |
class Component { | |
constructor(element, options) { | |
this.element = element; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pre($var){ | |
$styles = [ | |
'display:block', | |
'padding:1em', | |
'margin:1em', | |
'border-radius:3px', | |
'font-size:14px', | |
'font-family: monospace', | |
'white-space: pre-wrap', | |
'word-wrap: break-word', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Return the asset path as variable | |
* */ | |
function get_asset($url) | |
{ | |
return get_template_directory_uri() . '/assets/' . $url; | |
} | |
/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl http://loripsum.net/api/4 | wp post generate --post_content --count=10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{HTTP_ACCEPT} image/webp | |
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f | |
RewriteRule (.*)\-.*(jpe?g|png) $1.webp [T=image/webp,E=accept:1] | |
Source: | |
https://buttercms.com/blog/front-end-performance-optimization-techniques |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://medium.com/@romualdasromasdakeviius/using-vue-cli-to-build-wordpress-plugin-including-hmr-1a71dfdf05c2 | |
// https://medium.com/@devs_group/wordpress-vue-js-with-webpack-and-hot-reload-7c4faea9d0d9 | |
function is_develop_serve() | |
{ | |
$connection = @fsockopen('localhost', '8080'); | |
return $connection ? true : false; | |
} | |