Skip to content

Instantly share code, notes, and snippets.

View astrotars's full-sized avatar
⛰️

Nick Parsons astrotars

⛰️
View GitHub Profile
@astrotars
astrotars / Bcrypt.php
Created August 7, 2012 21:12
Simple PHP 5.3+ Bcrypt class and functions
<?php
/*
By Marco Arment <me@marco.org>.
This code is released in the public domain.
THERE IS ABSOLUTELY NO WARRANTY.
Usage example:
// In a registration or password-change form:
// build log data
$data = array(
account_id => 1,
array(
'type' => 'budget',
'message' => 'this is a test error message for budget'
),
array(
'type' => 'budget',
'message' => 'this is a test error message for budget'
@astrotars
astrotars / gist:3514220
Created August 29, 2012 15:19
App Data Format
?app_data={"ref":"ad","data":{"campaign_id":"1"}}
PS1='\w$ '
alias staging-mysql='pagoda -a aisle5-staging tunnel -c db1'
alias staging-redis='pagoda -a aisle5-staging tunnel -c cache1'
alias redis='redis-server'
alias redis-web='resque-web -p 8282 -F -r localhost:6379'
alias worker-start='php -f /Applications/MAMP/htdocs/aisle5/secure/workers/worker_start.php'
DB1_HOST="localhost"
export DB1_HOST
DB1_PORT="3306"
export DB1_PORT
DB1_NAME="bertha"
export DB1_NAME
DB1_USER="root"
@astrotars
astrotars / gist:3737721
Created September 17, 2012 14:32
app data
?app_data={"ref":"ads","data":{"ad_campaign_id:"1234"}}
{
"ref": "ads",
"data": {
"ad_campaign_id": "1234"
}
}
web1:
name: app
document_root: /public
php_version: 5.3.10
php_max_execution_time: 60
php_file_uploads: "1"
php_post_max_size: "64M"
php_upload_max_filesize: "64"
php_date_timezone: America/Denver
shared_writable_dirs:
@astrotars
astrotars / pre-commit
Created September 24, 2012 14:55
.git/hooks/pre-commit
#!/bin/sh
#
#current directory
#
DIR="$( cd "$( dirname "$0" )" && pwd )"
#
#concatenate all javascript files and compress
#using yuicompressor. output as min.js.
@astrotars
astrotars / pre-commit
Created September 24, 2012 15:54
JS and CSS compression using yuicompressor
#!/bin/sh
#
#current directory
#
DIR=$PWD;
#
#concatenate all javascript files and compress
#using yuicompressor. output as min.js.