Skip to content

Instantly share code, notes, and snippets.

View jkakar's full-sized avatar

Jamu Kakar jkakar

View GitHub Profile
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
# append to the history file, don't overwrite it
shopt -s histappend
-- Don't rollback the entire transaction if you typo a SQL query when
-- in interactive mode.
\set ON_ERROR_ROLLBACK interactive
-- Show query timing information.
-- Include transaction information in the prompt.
\set PROMPT1 '%[%033[33;1m%]%x%[%033[0m%]%[%033[1m%]%/%[%033[0m%]%R%# '
package main
import (
jkakar / .gitconfig
Last active December 25, 2015 20:39
cleanbranches = !/Users/jkakar/bin/
jkakar /
Created July 18, 2012 23:45
Deleting merged branches with Git
set -x
# Update the master branch.
git checkout master
git pull upstream master
# Synchronize the remote repository.
git push origin master
(when (load "flymake" t)
(defun flymake-pyflakes-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
(local-file (file-relative-name
(file-name-directory buffer-file-name))))
(list "/home/jkakar/.emacs.d/plugins/" (list local-file))))
// URI encode some text.
Handlebars.registerHelper('encode', function(property) {
var text = Ember.getPath(this, property);
return encodeURIComponent(text);
class Thingy(Storm):
id = Int(...)
_cache = {}
def getValue(self):
if 'value' in self._cache:
return self._cache['value']
# Load value from the database and cache it.
jkakar / gist:2008836
Created March 9, 2012 21:38
GET /values response with new 'updated-at' data
HTTP/1.1 200 OK
Content-Length: 817
Date: Mon, 02 Aug 2010 13:14:32 GMT
Content-Type: application/json
"results" : {
"id" : {
"05eee31e-fbd1-43cc-9500-0469707a9bc3" : {
"fluiddb/about" : {