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
my closeNotifications() | |
on closeNotifications() | |
tell application "System Events" | |
tell process "Notification Center" | |
set theWindows to every window | |
repeat with i from 1 to number of items in theWindows | |
set this_item to item i of theWindows | |
try | |
click button 1 of this_item |
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 R = require("ramda"); | |
var memoizeUntil = function (fn, expiry) { | |
var cache = {}; | |
var onExpiry = []; | |
var onCache = []; | |
var onCachedResult = []; | |
var memoized = function () { |
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
Function.prototype.__ = {}; | |
Function.prototype.curry = function () { | |
var fn = this, | |
args = Array.prototype.slice.call(arguments, 0); | |
while(args.length < fn.length) { | |
args.push(Function.prototype.__); | |
} |
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/env node | |
'use strict'; | |
/* Our bread & butter -- replaces a sub-string with something else */ | |
function _replace(str, start, end, replacement) { | |
return str.substr(0, start) + replacement + str.substr(end, str.length); | |
} | |
/* Replaces user mentions based on object from tweet.entities.user_mentions */ |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
alias please='sudo $(history -p \!\!)' |
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 | |
namespace App\ShopBundle\Security\Authentication\Provider; | |
use App\ShopBundle\Entity\Order; | |
use App\ShopBundle\Model\OrderManager; | |
use App\ShopBundle\Security\SessionToken; | |
use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface; | |
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; |
NewerOlder