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 | |
class MyHook | |
{ | |
public function run(&$arg) | |
{ | |
$arg = 'bar'; | |
} | |
} |
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 | |
// Global Configuration | |
$globalConfig = array | |
( | |
'key1' => 'val1', | |
'key2' => array | |
( | |
'key2.1' => 'val2.1', | |
'key2.2' => 'val2.2', |
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
var http = require('http'), | |
async = require('async'), | |
queueBuilder, | |
taskBuilder, | |
counter, | |
maxConcurrent = Number.POSITIVE_INFINITY, | |
debug = true, | |
queues = {}, | |
tasks = {}; |
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 | |
function setter($val) { | |
return function(&$val) use ($val) {} | |
}; | |
$fooSetter = setter('foo'); | |
$fooSetter($x); |
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 | |
function treeWalker($fnCallback, $strTable, $intStart=0, $orderBy='pid, sorting') | |
{ | |
$arrItemsByPid = array(); | |
$arrItems = \Database::getInstance()->execute('SELECT * FROM ' . $strTable . ' ORDER BY ' . $orderBy)->fetchAllAssoc(); | |
$strResult = ''; | |
foreach($arrItems as $arrItem) |
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
var page = require('webpage').create(), | |
system = require('system'), | |
address, output, size; | |
if (system.args.length < 3 || system.args.length > 5) { | |
console.log('Usage: rasterize.js URL filename'); | |
phantom.exit(1); | |
} else { | |
address = system.args[1]; | |
output = system.args[2]; |
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
var scrollTo = function($target) { | |
var $body = $('body,html'); | |
var currentOffset = $(window).scrollTop(); | |
var targetOffset = $target.offset().top; | |
var distance = Math.abs(currentOffset - targetOffset); | |
if (!$target.length) { | |
return; | |
} |
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($) { | |
var $question = $('#question'); | |
var $answer = $('#answer'); | |
var checkInterval = 250; | |
var cheat = function() { | |
var rawVal = $question.html(); | |
rawVal = rawVal.replace(' =', '') | |
.replace('x', '*') | |
.replace('÷', '/'); |
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
var Gpio = require('onoff').Gpio, | |
async = require('async'), | |
_ = require('underscore'); | |
var measureDistance = function(opts) { | |
var options = _.defaults(opts, { | |
trigger: 24, | |
echo: 25, | |
leds: [4, 17, 18, 27, 22, 23], | |
timeout: 2000 |
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
var engine = SearchEngine({ | |
url: 'http://localhost:3333/' | |
}); | |
engine.use(searchbox({ | |
el: '#box', | |
autocomplete: true | |
})); | |
engine.use(results({ |
OlderNewer