Skip to content

Instantly share code, notes, and snippets.

View fabrikagency's full-sized avatar

Aviso, LLC fabrikagency

View GitHub Profile
@fabrikagency
fabrikagency / sv-unicorn-run.erb
Created April 24, 2013 16:26
Rackbox runit script for unicorn
#!/bin/bash --login
#
# Supervises unicorn; stopping this service prompts a graceful shutdown of the
# current unicorn instance. Sending HUP to this service causes unicorn to re-exec
# itself for upgrades etc.
#
function is_pid_running() {
set +e
@fabrikagency
fabrikagency / Berksfile
Last active December 16, 2015 13:48
Knife Solo Setup on Rackspace Cloud
site :opscode
cookbook 'redisio'
cookbook 'git'
cookbook 'apt'
cookbook "runit", ">= 1.1.2" # HACK: force-use this version to use restart_on_update
cookbook 'rackbox'
@fabrikagency
fabrikagency / gist:732038
Created December 7, 2010 16:49
Most Useless PHP Class
<?php
class SimpleMath {
var $a;
var $b;
var $math;
public function add($a, $b){
$math = $a + $b;
return $math;
}
Gdn_MultiFileUpload.prototype.NewUploader = function() {
var NewUploaderID = null; var AutoShow = false;
if (this.CurrentInput == null) {
NewUploaderID = 1;
} else {
AutoShow = true;
NewUploaderID = parseInt(this.CurrentInput.split('_').pop()) + 1;
}
NewUploaderID = [this.AttachFileRootName,NewUploaderID].join('_');
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
@fabrikagency
fabrikagency / nginz-gzip.conf
Created June 10, 2009 21:19
nginx settings for good gzip compression
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# make sure gzip does not lose large gzipped js or css files
# see http://blog.leetsoft.com/2007/7/25/nginx-gzip-ssl
gzip_buffers 16 8k;