Skip to content

Instantly share code, notes, and snippets.

View corbanb's full-sized avatar

corban baxter corbanb

View GitHub Profile
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._
@corbanb
corbanb / setup-python-dev.sh
Created June 14, 2011 22:43
Easy setup for python virtualenv development enviorments
# Author: Corban Baxter
# Date created: 6/14/2011
# this is a handy shell script for devs to get setup with
# a local python development enviorment using virtualenv
# and virtualenvwrapper. to be used with osx 10.6 and up.
# Dependencies
# Xcode - download from developer.apple.com or via the Appstore (http://itunes.apple.com/us/app/xcode/id422352214?mt=12)
@corbanb
corbanb / gist2jsbin.js
Created June 30, 2011 23:27
gist2jsbin bookmarklet
//Created by: Corban Baxter
// Twitter: @corbanb
//Usage: coverts gist.github.com/ID to jsbin.com/gist/ID to easily run an HTMl/JS gist in browser
javascript:(function(){
var idPath = location.pathname;
var host = location.host;
var gistHostname = "gist.github.com";
var jsbinurl = "http://jsbin.com/gist";
@corbanb
corbanb / .custom_profile
Created July 1, 2011 14:59
corbanb bash_profile
alias ls="ls -aG"
source /usr/local/bin/virtualenvwrapper.sh
source ~/bin/.git_svn_profile
PATH=~/bin:$PATH
#NAVE and NODE JS
alias nave="~/local/nave/nave.sh"
alias lessc="~/code/less.js/bin/lessc"
@corbanb
corbanb / 10.04-LTS-EBS.json
Created June 21, 2012 21:28 — forked from ticean/10.04-LTS-EBS.json
CloudFormation Ubuntu AMI Mappings (Canonical)
"Mappings" : {
"AWSInstanceType2Arch" : {
"t1.micro" : { "Arch" : "64" },
"m1.small" : { "Arch" : "32" },
"m1.large" : { "Arch" : "64" },
"m1.xlarge" : { "Arch" : "64" },
"m2.xlarge" : { "Arch" : "64" },
"m2.2xlarge" : { "Arch" : "64" },
"m2.4xlarge" : { "Arch" : "64" },
"c1.medium" : { "Arch" : "32" },
[Mensch font](http://robey.lag.net/2010/06/21/mensch-font.html),
[Webkit](http://webkit.org),
[Chrome](http://google.com/chrome),
[Firefox](http://firefox.com),
[Kaleidoscope](http://www.kaleidoscopeapp.com),
[iTerm](http://iterm2.com),
[Transmit](http://panic.com/transmit),
[Coda](http://panic.com/coda),
[Sublime Text](http://www.sublimetext.com/dev),
[Sequel Pro](http://nightly.sequelpro.com),
@corbanb
corbanb / multi_php
Last active December 23, 2015 11:59
This will give you the ability to install multiple versions of php side by side. (via: https://coderwall.com/p/vn1iqg)
# More info - https://github.com/josegonzalez/homebrew-php#installing-multiple-versions
# install multiple versions of php with homebrew
brew tap josegonzalez/php
brew install php53 --with-fpm
brew install php54 --with-fpm
brew install php55 --with-fpm
# These are the aliases that will auto switch to the version you want to use.
alias use_php53="brew unlink php54 && brew unlink php55 && brew unlink php53 && brew link php53"
@corbanb
corbanb / unicorn.rb
Created September 20, 2013 15:37
Basic Unicorn and heroku config file.
worker_processes Integer(ENV['WEB_CONCURRENCY'] || 4)
timeout 120
preload_app true
listen ENV['PORT'].to_i || 3000, tcp_nopush: false
before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
Process.kill 'QUIT', Process.pid
@corbanb
corbanb / csv_to_html.php
Created January 10, 2014 00:23
Output CSV data into HTML with this simple script.
<?php
ini_set('auto_detect_line_endings',TRUE);
$handle = fopen("mydata.csv", "r");
?>
<ul>
<?php while ( ($data = fgetcsv($handle, 1000, ",")) !== FALSE ): ?>
<li>
<a href="<?= $data[4] ?>" class="product-container">
<img class="lazy" src="<?= $data[3] ?>" data-original="<?= $data[3] ?>">
<div class="post-details">