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 ShutdownFunctionManager { | |
protected $callbacks = array(); | |
protected $registered = false; | |
public function __construct($auto_register = true) { | |
if ($auto_register) { | |
$this->register(); | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<phpunit | |
printerClass="ProfilerPrinter" | |
printerFile="profiler.php" | |
> | |
</phpunit> |
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
{ | |
"name": "my-github-username/my-project-name", | |
"description": "Project description goes here", | |
"repositories": { | |
"other-github-username/other-github-project-name": { | |
"type": "package", | |
"package": { | |
"name": "other-github-username/other-github-project-name", | |
"version": "dev-master", |
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 BaseDecorator { | |
private $component; | |
private $methods = array(); | |
private $properties = array(); | |
public function __construct($component) { | |
$this->component = $component; | |
} |
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
#!/bin/sh | |
go build -buildmode=c-shared lib.go | |
clang main.m -g -Wall -Werror -Wfatal-errors -pedantic -Wno-c11-extensions -Wno-unused-variable -Wno-unused-function -o main.out |
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
$ brew doctor | |
Your system is raring to brew. | |
$ brew -v upgrade | |
Homebrew 0.9.3 | |
==> Upgrading vim | |
==> Cloning https://vim.googlecode.com/hg/ | |
Updating /Library/Caches/Homebrew/vim--hg | |
/usr/local/bin/hg pull | |
warning: vim.googlecode.com certificate with fingerprint af:26:ef:84:56:0d:c7:67:a8:86:8b:58:38:44:51:96:e4:90:bd:b2 not verified (check hostfingerprints or web.cacerts config setting) |
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 | |
$files = array_slice($argv, 1); | |
echo "[cache],[concurrency_level],[time],[requests],[failures],[requests_per_second],[time_per_request],[concurrent_time_per_request],[transfer_rate],[p50],[p66],[p75],[p80],[p90],[p95],[p98],[p99],[max]\n"; | |
foreach ($files as $file) { | |
if (in_array(array('run', 'summarize.php'), $files)) { | |
continue; | |
} |
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 ApplicationOctetStreamHandlerMiddleware(): | |
def process_request(self, request): | |
# @TODO support base64 encoding | |
# @TODO support content-disposition header and filename | |
content_type = request.META.get('CONTENT_TYPE') | |
try: | |
content_length = int(request.META.get('CONTENT_LENGTH', 0)) | |
except (ValueError, TypeError): | |
content_length = 0 |
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
# source: http://stackoverflow.com/a/5057305 | |
# finds all the files in the current directory, converts them to mp3, using | |
# the original file name and changing the file extension | |
find . | parallel ffmpeg -i {} -ab 192k -acodec libmp3lame -ac 2 {.}.mp3 |
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
# source: http://stackoverflow.com/questions/149057/how-to-removing-trailing-whitespace-of-all-files-recursively | |
find . -not \( -name .svn -prune -o -name .git -prune \) -type f -print0 | xargs -0 sed -i '' -E "s/[[:space:]]*$//" |