Skip to content

Instantly share code, notes, and snippets.

View zeroasterisk's full-sized avatar

alan blount zeroasterisk

View GitHub Profile
@zeroasterisk
zeroasterisk / example_cakeapp.conf
Created August 1, 2011 20:47
nginx.conf - example cakeapp
# Example CakePHP App config
server {
listen 80;
server_name domain.com www.domain.com asset.domain.com;
access_log /var/log/nginx/domain.access.log main;
error_log /var/log/nginx/domain.errors.log info;
root /var/www/prod/domain/app/webroot;
index index.php index.html index.htm;
include standard_location_config_cakephp;
@zeroasterisk
zeroasterisk / git-rmbranch
Created August 31, 2011 14:03
git-rmbranch script to facilitate easy branch removal, locally and on origin
#!/bin/bash
# -----------------------------------------------------------
# @requires confirm.sh in the same location as this script
# @link http://wuhrr.wordpress.com/2010/01/13/adding-confirmation-to-bash/
# -----------------------------------------------------------
# usage:
# git rmbranch branchname [branchname ...]
# will force delete N number of branches locally and on origin
SCRIPT="$(readlink -nf ${0#./})"
@zeroasterisk
zeroasterisk / git-dev2master
Created September 13, 2011 20:04
git-dev2master save in your path, to make dev2master migrations one command
#!/bin/bash
# -----------------------------------------------------------
# super basic script to migrate dev to master
# script continues if all processes go correctly
# all step-results echoed to screen
#
# usage:
# git dev2master
#
# -----------------------------------------------------------
#!/bin/bash
# Assumes you will have this file in the repo root level folder
SCRIPT="$(readlink -nf ${0#./})"
SCRIPTNAME="${0##*/}"
ROOTBASE="${SCRIPT%/*}"
cd $ROOTBASE
git submodule init && git submodule update
$ROOTBASE/app/cake bisect script
<?php
/**
* This tester is a great tool for testing something in an easy way to make git bisect work for you
* note: not part of the repo, so it's not overwritten by git
* @link http://book.git-scm.com/5_finding_issues_-_git_bisect.html
* @link http://alblue.bandlem.com/2011/07/git-tip-of-week-git-bisect.html
*/
class BisectShell extends Shell{
var $uses = array('Event', 'Util', 'Asset');
# test: return true/false
# ~rtomayko/.screenrc
# -------------------------------------------------------------------
# Settings
# -------------------------------------------------------------------
crlf off # No Microsoft linebreaks
startup_message off # bypass GPL notice (we're aware)
defscrollback 15000 # big scrollback
#shell bash # don't start login shells
shelltitle "" # no title by default - set in PS1
@zeroasterisk
zeroasterisk / uploaded_file.php
Created March 17, 2012 06:51
classes to help with UploadedFileXhr
<?php
/**
* Handle file uploads via XMLHttpRequest
*/
class UploadedFileXhr {
/**
* Save the file to the specified path
* @return boolean TRUE on success
*/
@zeroasterisk
zeroasterisk / litleRecyclerDate
Created March 23, 2012 13:46
litleRecyclerDate()
$recycle_date = null;
// if 305 (Expired Card) -- we alter the cc_expires on retries every 4 days
if ($response_code == 305 && $attempts < 5) {
$cc_expires_year_increment = 0;
if ($attempts==1) {
// increment expires year by 3 = ~30% fix
$cc_expires_year_increment = 3;
} elseif ($attempts==2) {
// increment expires year by 2 = ~20% fix
$cc_expires_year_increment = 2;
@zeroasterisk
zeroasterisk / gist:2171723
Created March 23, 2012 15:22
Sublime Text 2 - User Keybindings
[
// plugins
{ "keys": ["ctrl+shift+t"], "command": "whitespacecorrector" },
{ "keys": ["ctrl+x"], "command": "clipboard_manager_cut" },
{ "keys": ["ctrl+c"], "command": "clipboard_manager_copy" },
{ "keys": ["ctrl+v"], "command": "clipboard_manager_paste", "args": { "indent": true } },
{ "keys": ["ctrl+alt+v"], "command": "clipboard_manager_paste", "args": { "indent": false } },
{ "keys": ["ctrl+shift+v"], "command": "clipboard_manager_choose_and_paste" },
{ "keys": ["ctrl+i", "ctrl+alt+v"], "command": "clipboard_manager_next_and_paste" },
{ "keys": ["ctrl+i", "ctrl+shift+v"], "command": "clipboard_manager_previous_and_paste" },
@zeroasterisk
zeroasterisk / xcache.ini
Created March 27, 2012 13:46
xcache ini example
; configuration for php Xcache module
[xcache-common]
;; install as zend extension (recommended), normally "$extension_dir/xcache.so"
zend_extension = /usr/lib/php5/20090626/xcache.so
[xcache.admin]
xcache.admin.auth = On
xcache.admin.user = "appadmin"
;xcache.admin.pass = md5(yourpassword)