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 | |
call_user_func(function(){ | |
$purge = function ($post_id) { | |
if ('acf' === get_post_type($post_id) && !wp_is_post_revision($post_id)) { | |
wp_cache_delete('field_groups', 'acf'); | |
} | |
return $post_id; | |
}; | |
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 pipeall(array) { | |
var chain = []; | |
var next; | |
var next_val = 0; | |
var tramp = function(result) { | |
var stage = chain[--next]; | |
var fn; | |
if(next) { | |
fn = function() { | |
stage(result, tramp); |
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 | |
/** | |
* MegaMethods | |
* =========== | |
* | |
* They do stuff, on steroids | |
**/ | |
namespace MM; |
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
class Node: | |
def __init__(self): | |
self.terminal = False | |
self.suffixes = {} | |
def update(node, suffix): | |
for c in suffix: | |
if c not in node.suffixes: | |
node.suffixes[c] = Node() | |
node = node.suffixes[c] |
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 Slist { | |
var $data = NULL; | |
var $next = NULL; | |
function __construct($data, $next) { | |
$this->data = $data; | |
$this->next = $next; | |
} |
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 asserteq($lhs, $rhs) { | |
if($lhs != $rhs) | |
exit "$lhs != $rhs"; | |
} | |
if(LOCAL) | |
$foo = new foo_direct(getenv('FOO_DB_STUFF')); | |
else | |
$foo = new foo_http(getenv('FOO_ENDPOINT')); |