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 countCSSRules() { | |
var results = '', | |
log = ''; | |
if (!document.styleSheets) { | |
return; | |
} | |
for (var i = 0; i < document.styleSheets.length; i++) { | |
countSheet(document.styleSheets[i]); | |
} | |
function countSheet(sheet) { |
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 | |
/* | |
Plugin Name: JSON feed | |
Plugin URI: http://wordpress.org/extend/plugins/json-feed/ | |
Description: Provides feeds in JSON form | |
Version: 1.3 | |
Author: Chris Northwood (modified by Dan Phiffer) | |
Author URI: http://www.pling.org.uk/ | |
Contributors: @jimakker | |
Comments: works on WP 3.4.1 |
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 | |
/* | |
JSON Controller for JSON API WordPress Plugin to return posts in Timeline format for Verite Timeline WordPress Plugin | |
Author: Miguel Peixe | |
Reference: http://wordpress.org/support/topic/plugin-verite-timeline-getting-wordpress-posts-into-timeline | |
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 | |
$json ='{"id":1,"name":"foo","interest":["wordpress","php"]} '; | |
$obj=json_decode($json); | |
echo $obj->interest[1]; //prints php | |
?> |
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 | |
/** | |
* Plugin Name: Run-Once Data Importer | |
* Description: This plugin will add custom field data to a predefined set of posts | |
* Version: 1.0 | |
* Author: mattbeck | |
*/ | |
register_activation_hook( __FILE__, 'runonce_data_import' ); |
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
/* | |
* BEM Mixin | |
* | |
* Block / Element / Modifier | |
* | |
* Example: | |
* | |
* @include b(test) { | |
* background: red; | |
* @include m(modifier) { |
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
/* | |
_____ _ _ ___ ___ _ _ _ _ | |
/ ___|(_) | | | \/ | | | | | | | (_) | |
\ `--. _ __ _ _ __ ___ __ _ | | __ | . . | ___ | | __| |__ | |_ __ _ _ __ _ | |
`--. \| | / _` || '_ ` _ \ / _` || |/ / | |\/| | / _ \ | |/ /| '_ \ | __|/ _` || '__|| | | |
/\__/ /| || (_| || | | | | || (_| || < | | | || (_) || < | | | || |_| (_| || | | | | |
\____/ |_| \__,_||_| |_| |_| \__,_||_|\_\ \_| |_/ \___/ |_|\_\|_| |_| \__|\__,_||_| |_| | |
www.siamak.us | |
== Mixin of BEM selectors with SCSS: == |
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
exports.stripComments = function stripComments(toBeStrippedStr){ | |
//LEXER | |
function Lexer () { | |
this.setIndex = false; | |
this.useNew = false; | |
for (var i = 0; i < arguments.length; ++i) { | |
var arg = arguments [i]; | |
if (arg === Lexer.USE_NEW) { | |
this.useNew = true; | |
} |
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 | |
$list = file_get_contents('https://gist.githubusercontent.com/xolf/84ff46881bae03741b57/raw/bfe1bda4c24024a571c697abedcfb03ef3f5feb3/xolf.json'); | |
$list = json_decode($list); | |
var_dump($list); | |
foreach ($list->pages as $page) { | |
$start = microtime(true); |
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
/*------------------------------------*\ | |
* #element-modifier-class | |
* BEM element & modifier classes | |
* Using @at-root provides nesting declarations in Sass, | |
* but compiles them to the stylesheet’s root. | |
\*------------------------------------*/ | |
/** | |
* @mixin element | |
* Create a child element declaration |
OlderNewer