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 closureify(callable $fn) | |
{ | |
return function() use ($fn) { | |
return call_user_func_array($fn, func_get_args()); | |
}; | |
} |
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 callable_test.php | |
bool(false) | |
bool(true) | |
<?php | |
class Test { | |
public function __invoke() {} | |
} | |
var_dump(is_callable('Test')); |
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 App\Http\Middleware; | |
use Closure; | |
class NoCache { | |
/** | |
* Handle an incoming request. | |
* | |
* @param \Illuminate\Http\Request $request |
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
<div class="campaign-property-container"> | |
<div class="campaign-property-value"> | |
<? if ($Campaign->started()): ?> | |
<? if ($Campaign->running()): ?> | |
<span class="campaign-status mod-running">Running</span> | |
<? elseif ($Campaign->ended()): ?> | |
<span class="campaign-status mod-ended">Ended</span> | |
<? elseif ($Campaign->pending()): ?> | |
<span class="campaign-status mod-scheduled">Scheduled</span> | |
<? endif; ?> |
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 getPageHistory() { | |
var hist = $.cookie('history'); | |
try { | |
hist = JSON.parse(hist); | |
if (false == $.isArray(hist)) hist = []; | |
} | |
catch (e) | |
{ |
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
#!/usr/bin/python | |
import os | |
import random | |
import time | |
os.system("osascript -e 'set volume 1' 2>/dev/null"); | |
phrases = ("Help me, I'm stuck in here!", "Is anyone out there?", "Can anybody hear me?", "S O S", "It's dark in here..", "I'm watching you", "Please don't look at me like that", "Don't touch me there!", "What are you doing?", "Who are you?", "I know what you're typing...", "I wouldn't say that if I were you..") | |
voices = ("Zarvox", "Fred", "Ralph", "Victoria", "Princess", "Alex") |
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
# in web browser | |
# http://uec-images.ubuntu.com/releases/karmic/release/ | |
# canonical karmic 64-bit AMI: | |
# ami-55739e3c | |
# canonical karmic 32-bit AMI: | |
# ami-bb709dd2 | |
# https://console.aws.amazon.com/ec2/home#c=EC2&s=Instances | |
# Launch Instance > Community AMIs |
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 MyException extends Exception | |
{ | |
public function getType() { return 'NotException'; } | |
} | |
function doTest() | |
{ | |
$e = new MyException('stupid php', 1); |
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 request = require('request'), | |
_ = require('underscore'); | |
var MANDRILL_API_ROOT = 'https://mandrillapp.com/api/1.0/'; | |
function makeMandrill(key) | |
{ | |
function mandrill(path, opts, callback) | |
{ | |
console.log(this.key, 'key'); |
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
The Trustees of Reservations: Berkshires | |
"e" inc. | |
11:11 Theatre Company | |
17 Cox | |
185 Photos | |
33 Restaurant & Lounge | |
3rd Wheel Comedy | |
3Scoops Cafe and Gallery | |
4th Floor Artists | |
54th Mass Volunteer Infantry, Company 'A' |