This file contains 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
/** | |
* Basic event system. Use in component or as event bus | |
* Author: Chris Panayotoff <chris.panayotoff[at]gmail[dot]com> | |
*/ | |
export default class Eventify { | |
constructor() { | |
this.list = {}; | |
} |
This file contains 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
{ | |
"watch": ["src"], | |
"ext": "ts", | |
"ignore": ["src/**/*.spec.ts"], | |
"exec": "ts-node ./src/index.ts" | |
} |
This file contains 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
const util = require('util'); | |
const exec = util.promisify(require('child_process').exec); | |
const wp_path = '/Users/<User>/Documents/Sites/<WP>'; | |
async function seed(postData = {}, rawArgs = {}) { | |
const wpArgs = { ...rawArgs }; | |
let postId; | |
let featuredImageId; |
This file contains 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; | |
} | |
This file contains 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 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 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 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 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; |
NewerOlder