Skip to content

Instantly share code, notes, and snippets.

View EranSch's full-sized avatar
🤠
Yeee-haw!

Eran Schoellhorn EranSch

🤠
Yeee-haw!
View GitHub Profile
alert('hello');
// given:
var sayHello = (function (name) {
var text = 'Hello, ' + name;
return function () {
console.log(text);
};
})('REX');
sayHello(); // This prints 'REX' to the console
@EranSch
EranSch / hack.php
Created September 15, 2016 16:03
hack
$cat_counts = (new F\MaybeEmpty($full_query->get_posts()))
->bind($posts ==> array_map($p ==> wp_get_post_categories($p->ID), $posts))
->bind('tft\fp\flatten')
->bind($cats ==> F\reduce($cats, function($carry, $id) {
$carry[$id]++;
return $carry;
}), [])
->extract();
@EranSch
EranSch / external-links.js
Created October 12, 2016 14:04
Rewrite links leaving site