Some CoffeeScript (verbosely commented for clarity)
# Override Rails handling of confirmation
$.rails.allowAction = (element) ->
# The message is something like "Are you sure?"
message = element.data('confirm')
# Make it use C-a, similar to screen.. | |
unbind C-b | |
unbind l | |
set -g prefix C-a | |
bind-key C-a last-window | |
# Reload key | |
bind r source-file ~/.tmux.conf | |
set -g history-limit 1000 |
Here's how to install PostgreSQL and have it run automatically at startup, on an Ubuntu 10.04 virtual machine using Vagrant. This took me a while to figure out:
Add the default lucid32 base box to your vagrant, if you haven't already:
host> vagrant box add lucid32 http://files.vagrantup.com/lucid32.box
Now make a new lucid32 virtual machine and install postgresql on it:
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"userid": "mohit", "password":"password"}' http://mmedwebdemo.ddns.comp.nus.edu.sg:8080/comp.nuhs.jaxb/api/usr/login |
[alias] | |
humiliate = "!sh -c 'RECIPIENTS=`git blame $0 -e -L $1 | sed \"s/.* (<\\(.*\\)> .*/\\1/\" | sort | uniq | paste -sd \",\" -` ; git blame $0 -L $1 | mail -s \"WTF is this?\" $RECIPIENTS;'" |
from django.conf.urls import include, patterns, url as django_url | |
import re | |
def url(pattern, view, kwargs=None, name=None, prefix='', constraints={}): | |
''' | |
url('/path/:id/to/:something/', some_view, constraints={'id': r'\d{4}'}) | |
''' | |
def convert(match): | |
name = match.group(1) |
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |