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 debounce(a,b,c){var d;return function(){var e=this,f=arguments;clearTimeout(d),d=setTimeout(function(){d=null,c||a.apply(e,f)},b),c&&!d&&a.apply(e,f)}} |
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
AddType application/x-httpd-php .js .css | |
AddHandler x-httpd-php5 .js .css | |
<FilesMatch "\.(js|php|css)$"> | |
SetHandler application/x-httpd-php | |
</FilesMatch> |
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 | |
$submodules = array_filter(explode("\n", file_get_contents('./gitmodules'))); | |
for($i = 0; $i < count($submodules); $i += 3) { | |
$path = str_replace('path = ', '', trim($submodules[$i + 1])); | |
$url = str_replace('url = ', '', trim($submodules[$i + 2])); | |
if($path && $url) { | |
$path = "./$path"; |
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 | |
$gitCookbookUrls = 'https://gist.githubusercontent.com/SamuelDavis/40f12c099f2c6ce19848/raw/36a3e32e4771b09f08cf5b91404ac85e68d21f5a/git-cookbook-urls.json'; | |
$cookbookUrls = json_decode(file_get_contents($gitCookbookUrls), TRUE); | |
$existingCookbooks = scandir('./cookbooks'); | |
if(!$existingCookbooks) { | |
die("No existing cookbooks found.\n"); | |
} |
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
{ | |
"apt": "git://github.com/opscode-cookbooks/apt.git", | |
"ark": "git://github.com/opscode-cookbooks/ark.git", | |
"build-essential": "git://github.com/opscode-cookbooks/build-essential.git", | |
"curl": "git://github.com/phlipper/chef-curl.git", | |
"php": "git://github.com/opscode-cookbooks/php.git", | |
"xml": "git://github.com/opscode-cookbooks/xml.git", | |
"chef-sugar": "git://github.com/sethvargo/chef-sugar.git", | |
"iis": "git://github.com/opscode-cookbooks/iis.git", | |
"mysql": "git://github.com/opscode-cookbooks/mysql.git", |
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 initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; | |
// The base Class implementation (does nothing) | |
Object.Class = function(){}; | |
// Create a new Class that inherits from this class | |
Class.extend = function(prop) { | |
var _super = this.prototype; |
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 | |
namespace Lib; | |
class Arr | |
{ | |
public static function set(string $key, $value, array $container = []): array | |
{ | |
list($keys, $valueKey) = static::breakKey($key); | |
$end = &static::seekEnd($keys, $container); |
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
async function clock(actions, timeout) { | |
start = performance.now() | |
for (let i = 0; i < actions.length; i++) { | |
await actions[i]() | |
} | |
return setTimeout(clock.bind(clock, actions, timeout), timeout - (performance.now() - start)) | |
} | |
clock(new Array(3).fill(undefined).map((_, i) => () => { | |
console.log(i, performance.now()) | |
return new Promise(res => setTimeout(res, 500)) |
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 pretty($thing) | |
{ | |
return str_replace([ | |
'{', '}', ':', | |
], [ | |
'[', ']', ' =>', | |
], json_encode($thing, JSON_PRETTY_PRINT)); | |
} |
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 Debug | |
{ | |
public static $TIMESTAMPS = []; | |
public static function timestamp(string $key = null) | |
{ | |
$key = $key ?: count(static::$TIMESTAMPS); | |
static::$TIMESTAMPS[$key] = microtime(true); |
OlderNewer