Skip to content

Instantly share code, notes, and snippets.

task :deploy => ['deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
task :migrations => [:push, :off, :migrate, :restart, :on, :tag]
task :rollback => [:off, :push_previous, :restart, :on]
task :push do
puts 'Deploying site to Heroku ...'
puts `git push heroku`
end
@radamant
radamant / haml_converter.rb
Created July 19, 2010 14:16
Simple haml-sass conversion for jekyll
module Jekyll
require 'haml'
class HamlConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /haml/i
end
@ianloic
ianloic / git-prompt.zsh
Created June 25, 2011 19:55
Showing the Git module and status
setopt prompt_subst
autoload colors zsh/terminfo
colors
function __git_prompt {
local DIRTY="%{$fg[yellow]%}"
local CLEAN="%{$fg[green]%}"
local UNMERGED="%{$fg[red]%}"
local RESET="%{$terminfo[sgr0]%}"
git rev-parse --git-dir >& /dev/null
@tobert
tobert / start-lxc-cluster.sh
Created August 29, 2011 04:54
instant lxc cluster
#!/bin/bash
COUNT=10
BRIDGE="br1"
FORMAT="lxc%d"
PARENT=$(hostname --fqdn)
LXC_ROOT=/srv/virt/lxc
OS_ROOT=/srv/virt/lxc/base/root
for num in $(seq 1 $COUNT)
@necolas
necolas / README.md
Last active March 28, 2024 20:34
Experimenting with component-based HTML/CSS naming and patterns

NOTE I now use the conventions detailed in the SUIT framework

Template Components

Used to provide structural templates.

Pattern

t-template-name
@holman
holman / gemspec-usage.md
Created February 12, 2012 07:02
test/spec/mini

Just install this in your apps like so:

gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'

@paolorossi
paolorossi / html5-video-streamer.js
Created March 7, 2012 13:21
Node.js HTML5 video streamer
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';
@jrochkind
jrochkind / gist:2161449
Created March 22, 2012 18:40
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@qoda
qoda / .virtualenvhelper
Last active September 19, 2016 20:03
Virtualenv Auto-activate
cd ()
{
builtin cd "$@"
RETVAL=$?
# Test for successful real cd:
if [ 0 -ne $RETVAL ]; then
return $RETVAL
fi
@heiths
heiths / mayaOnUbuntu.sh
Last active February 28, 2024 18:50
Shell script to install and setup Autodesk Maya 2014 on Ubuntu 13.04
#!/bin/bash
#Heith Seewald 2012
#Feel free to extend/modify to meet your needs.
#Maya on Ubuntu v.1
#This is the base installer... I’ll add more features in later versions.
#if you have any issues, feel free email me at heiths@gmail.com
#### Lets run a few checks to make sure things work as expected.
#Make sure we’re running with root permissions.
if [ `whoami` != root ]; then