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 | |
/** | |
* Register globals sucks | |
* use with 'auto_prepend_file' directive | |
*/ | |
foreach (array($_ENV, $_GET, $_POST, $_COOKIE, $_SERVER) as $source) { | |
foreach ($source as $key => $val) { | |
$GLOBALS[$key] = $val; | |
} | |
} |
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/php | |
<?php | |
/** | |
* save as /opt/fakemail-imap.php | |
* set execute bit: chmod +x /opt/fakemail-imap.php | |
* add to php.ini: sendmail_path = /opt/fakemail-imap.php | |
*/ | |
$params = array( | |
'mailbox' => '{localhost}INBOX', // see http://php.net/manual/en/function.imap-open.php |
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 | |
var_dump(array_combine(array_keys(array_slice(get_defined_vars(), 0, func_num_args())), 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
#!/bin/bash | |
branch=$1 | |
mergeBase=`git merge-base HEAD $branch` | |
if [ $? -ne 0 ]; then | |
exit $? | |
fi | |
while true; do |
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
### NVM | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
# https://github.com/creationix/nvm#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file | |
autoload -U add-zsh-hook | |
load-nvmrc() { | |
local node_version="$(nvm version)" | |
local nvmrc_path="$(nvm_find_nvmrc)" |