Skip to content

Instantly share code, notes, and snippets.

View yoren's full-sized avatar

Yoren Chang yoren

View GitHub Profile
@yoren
yoren / php_get_extension.php
Created March 23, 2012 09:37 — forked from rugbyprof/php_get_extension.php
Php return file extension
function get_file_ext( $filename )
{
return end( explode( ".", $filename ) );
}
<?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';
@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