Skip to content

Instantly share code, notes, and snippets.

function __rvm_prompt {
rvm-prompt ' ' i v g
}
function __color_prompt {
local G='\[\033[01;32m\]'
local B='\[\033[01;34m\]'
local W='\[\033[00m\]'
local R='\[\033[01;31m\]'
local Y='\[\033[01;33m\]'
@julien-duponchelle
julien-duponchelle / oneiric
Created July 23, 2012 19:57
Support scratchbox for oneiric in debootstrap (/usr/share/debootstrap/scripts/oneiric)
case $ARCH in
amd64|i386)
default_mirror http://archive.ubuntu.com/ubuntu
;;
sparc)
case $SUITE in
gutsy)
default_mirror http://archive.ubuntu.com/ubuntu
;;
*)
@julien-duponchelle
julien-duponchelle / backup.sh
Created February 27, 2012 16:09
Dotcloud backup to S3 improved
#!/bin/bash
#
# Improved version of http://docs.dotcloud.com/guides/backups/
#
HOSTNAME=`hostname`
TAG="${HOSTNAME}_$(TZ=UTC date +%Y-%m-%d_%H:%M:%S_UTC)"
[ "$3" ] || {
echo "Please specify what to backup, how, and where."
@julien-duponchelle
julien-duponchelle / semaphore.js
Created January 31, 2012 21:22 — forked from jayjanssen/semaphore.js
Node.js semaphores
var Semaphore = function(callback, context) {
this.semaphore = 0;
this.callback = callback;
this.context = context || this;
};
Semaphore.prototype.increment = function(i)
{
if (i == undefined) {
i = 1;