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 | |
class swDFPBaseModule | |
{ | |
private function parent_or_child($tax, $query_key) | |
{ | |
$slug = $wp_query->query_vars[$query_key] | |
$s = get_term_by('slug', $slug, $tax); | |
return ($s->parent>0) ? | |
'get_on_'.$tax.'_page' : 'get_on_child_'.$tax.'_page'; |
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
Class Task extends ActiveRecord\Model | |
{ | |
public static $table = 'tasks'; | |
public function set_history($history) | |
{ | |
$this->assign_attribute('history', serialize($history)); | |
} |
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
#!/usr/bin/php | |
<?php | |
/** | |
* .git/hooks/pre-commit | |
* | |
* This pre-commit hooks will check for PHP error (lint), and make sure the code | |
* is PSR compliant. | |
* | |
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer) | |
* |
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 | |
$x = function($bar, $foo="9") { | |
echo $foo, $bar, "\n"; | |
}; | |
class MissingArgumentException extends Exception { | |
} | |
function call_user_func_named_array($method, $arr){ |
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
var tourApp = { | |
tabSteps: { | |
8: 'images', | |
12: 'users' | |
}, | |
needsTweaking: function(i) { | |
return typeof tourApp.tabSteps[i] != 'undefined'; | |
}, | |
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
var tourApp = { | |
tabSteps: { | |
8: 'images', | |
12: 'users' | |
}, | |
needsTweaking: function(i) { | |
return typeof tourApp.tabSteps[i] != 'undefined'; | |
}, | |
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
<script type="text/javascript"> | |
var tourApp = { | |
tabSteps: { | |
3: 'images', | |
10: 'users', | |
}, | |
needsTweaking: function(i) { | |
return typeof tourApp.tabSteps[i] != 'undefined'; |
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
<script type="text/javascript"> | |
function Drawium_explain_box_displayed(index){ | |
console.log(index); | |
$("#binno-custom-tabs li").unbind('click.drawium'); | |
if (index == 1) { | |
$(".drawium_next_button").remove(); | |
$("#binno-custom-tabs li:nth-child(2)").bind('click.drawium', function() { | |
Drawer.tutorial_next(); | |
}); | |
} |
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
var nGramr = {} | |
nGramr.words = prompt('Whats the phrase?').split(' '); | |
nGramr.wordlen = nGramr.words.length; | |
nGramr.depth = prompt('Whats the n?'); | |
nGramr.results = 0; | |
nGramr.grams = function(aWords) { | |
var words = aWords; | |
var depth = words.length; | |
console.log(depth); | |
_.each(nGramr.words, function(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
var mainQuery = { | |
'ids': 'FILL_THIS_IN', | |
'start-date': '2012-01-19', | |
'end-date': '2012-02-05' | |
'dimensions': 'ga:pageTitle,ga:hostName,ga:pagePath,ga:date', | |
'metrics': 'ga:pageviews,ga:visits,ga:timeOnSite', | |
'sort': '-ga:pageviews', | |
'max-results': 100000 | |
}; |