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
# 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
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
<?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
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
# 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 |
NewerOlder