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
# backup_060403.tar.gz | |
tar -czf backup_$(date +%y%m%d).tar.gz | |
# test_20110519-150054.jpg | |
mv example.jpg test_$(date +%Y%m%d-%H%M%S).jpg | |
# test_1305835327.jpg (timestamp) | |
mv example.jpg test_$(date +%Y%m%d-%H%M%S).jpg |
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
RewriteEngine on | |
RewriteCond %{SERVER_PORT} ^443$ | |
RewriteCond %{REQUEST_URI} !^/facebook_app | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] | |
# This lets traffic that isn’t on port 443 (ssl) and isn't at /facebook_app/* | |
# and redirects it to the same path, but with SSL. This essentially lets stuff in | |
# /facbeook_app/* slide through over ssl or non-ssl, but nothing else. |
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 | |
// Sample Usage | |
$uri_to_fetch = 'http://example.tld/path/to/uri'; | |
$cache_on = true; | |
$cache_key = md5( $uri_to_fetch ); | |
$cache_ttl = 60 * 15; // 15 minutes | |
$cache_file = '/tmp/example.tld/'.$cache_key; | |
if (file_exists($cache_file) && |
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
require 'rubygems' | |
require 'selenium-webdriver' | |
driver = Selenium::WebDriver.for :ie | |
driver.get "https://www.google.com" | |
driver.save_screenshot("./screen.png") |
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
# change permissions for all files, skipping dirs | |
find . -type f | xargs chmod 664 | |
# change permissions for all dirs, skipping files | |
find . -type d | xargs chmod 775 |
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 | |
# Automated Deployments from Bitbucket/Github Service Hook | |
# Graciously borrowed from: http://brandonsummers.name/blog/2012/02/10/using-bitbucket-for-automated-deployments/ | |
date_default_timezone_set('America/Chicago'); | |
class Deploy { | |
/** | |
* A callback function to call after the deploy has finished. |
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 | |
GIT_WORK_TREE=/home/username/webapps/django/myproject git checkout -f | |
GIT_WORK_TREE=/home/username/webapps/django/myproject git reset --hard |
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
# http://mesmor.com/2012/03/18/akamai-pragma-debug-headers/ | |
alias akacurl='curl -v -s -o /dev/null -H "accept-encoding: gzip" -H "Pragma: akamai-x-get-cache-key" -H "Pragma: akamai-x-cache-on" -H "Pragma: akamai-x-cache-remote-on" -H "Pragma: akamai-x-get-true-cache-key" '; | |
akacurl http://example.com/akamai-test-object.html; |
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
# Local Dates: | |
git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt | |
# ISO Dates: | |
git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt |
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
# Push changes from development branch into production | |
# Add to .git/config | |
[alias] | |
deploy = !sh -c 'git checkout master && git merge development && git checkout development && git push --all' |
OlderNewer