Skip to content

Instantly share code, notes, and snippets.

View yoren's full-sized avatar

Yoren Chang yoren

View GitHub Profile
@yoren
yoren / 0_reuse_code.js
Created May 31, 2014 15:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
/**
* Load the template data from a file (file must be .html or .htm )
*/
//load from child theme or parent theme
$file = 'template.html';
echo caldera_metaplate_from_file( $file, $post_id );
//or use absolute patth
//$file = __FILE__ . '/template.html';

Zip excluding specific directories

Exclude .git file and node_modules directory

$ zip -r9 [target_file] [source_file] -x *.git* node_modules/\*

Exclude .git file and files in node_modules directory, but keep node_modules directory

$ zip -r9 [target_file] [source_file] -x *.git* node_modules/**\*