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
<VirtualHost *:80> | |
# Name for your virtualhost | |
ServerName mailhog.myawesomedomain.com | |
# Proxy config | |
ProxyPreserveHost On | |
ProxyRequests Off | |
# Websocket proxy needs to be defined first | |
ProxyPass "/api/v2/websocket" ws://localhost:8025/api/v2/websocket |
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
import readline; print('\n'.join([str(readline.get_history_item(i + 1)) for i in range(readline.get_current_history_length())])) |
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
from selenium import webdriver | |
chromdriver_path='/path/to/chromedriver' | |
PROXY = "socks5://localhost:9050" | |
options = webdriver.ChromeOptions() | |
options.add_argument('--proxy-server=%s' % PROXY) | |
driver = webdriver.Chrome(chrome_options=options, executable_path=chromdriver_path) | |
driver.get("http://check.torproject.org") |
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
#Zend_Db_Statement_Pdo::_execute | |
public function _execute(array $params = null) | |
{ | |
try { | |
if ($params !== null) { | |
return $this->_stmt->execute($params); | |
} else { | |
return $this->_stmt->execute(); | |
} |
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
if [ -z "$1" ]; then | |
echo "Usage: $0 http://your.domain.com/url" | |
exit 0 | |
fi | |
#get this from Account section in Cloudflare | |
TOKEN="YOUR_TOKEN_HERE" | |
EMAIL="YOUR_EMAIL_HERE" | |
DOMAIN="YOUR_DOMAIN_HERE" | |
curl https://www.cloudflare.com/api_json.html \ |
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
#!/bin/bash | |
# install homebrew's official php tap | |
brew tap josegonzalez/homebrew-php | |
# install homebrew-dupes (required to install zlib, php54's dependency) | |
brew tap homebrew/dupes | |
# install nginx + mysql + php 5.4 + php-fpm + apc + xdebug | |
brew install nginx mysql |
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
/** | |
* Test if a div with the class .col-main is present on homepage | |
*/ | |
console.log('checking cli options'); | |
var casper_cli = require("casper").create(); | |
if(!casper_cli.cli.options.url){ | |
console.log("--url=domain.com missing"); | |
casper_cli.exit(); | |
} |
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
#!/bin/bash | |
GIT_TOKEN="YOUR_TOKEN_HERE" | |
GIT_USER="YOUR_USER_HERE" | |
GIT_REPO="YOUR_REPO_HERE" | |
curl -X POST -H "Authorization: token $GIT_TOKEN" \ | |
--data '{"name": "web","active": true,"events": ["pull_request"],"config": {"url": "http://your.url.here/"}}' \ | |
https://api.github.com/repos/$GIT_USER/$GIT_REPO/hooks | |
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
#!/bin/bash | |
usage() | |
{ | |
cat << EOF | |
usage: $0 pull_id | |
pull_id needs to be a number | |
EOF | |
} | |
if [ -z "$1" ] |
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
wget https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2 | |
bunzip2 phantomjs-1.9.1-linux-x86_64.tar.bz2 | |
tar xf phantomjs-1.9.1-linux-x86_64.tar | |
mv phantomjs-1.9.1-linux-x86_64/ /opt/ | |
ln -s /opt/phantomjs-1.9.1-linux-x86_64/ /opt/phantomjs | |
ln -s /opt/phantomjs/bin/phantomjs /usr/local/bin/ | |
#check what you've just done | |
which phantomjs | |
phantomjs --version |