Skip to content

Instantly share code, notes, and snippets.

View swaroopch's full-sized avatar

Swaroop CH swaroopch

View GitHub Profile
set grepprg=ack
set grepformat=%f:%l:%m
autocmd FileType make set noexpandtab
autocmd FileType python set noexpandtab
set hlsearch
let mapleader = ","
@swaroopch
swaroopch / flask-boilerplate-tmux.bash
Created December 5, 2010 07:00
A command that scripts a tmux session
#!/bin/bash
function flask-boilerplate-tmux
{
# https://github.com/swaroopch/flask-boilerplate
BASE="$HOME/code/flask-boilerplate"
cd $BASE
tmux start-server
tmux new-session -d -s flaskboilerplate -n model
@jdmaturen
jdmaturen / worker3.py
Created January 25, 2011 03:42
Redis stats aggregator w/ Gevent
import gevent
from gevent import monkey
monkey.patch_socket()
import hashlib
import os
import redis
@stefanfoulis
stefanfoulis / osx_developer_installation.rst
Last active April 21, 2025 07:12
Instructions on how to setup an OSX developer machine for (python/django) development

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User

@xjamundx
xjamundx / gist:911831
Created April 9, 2011 22:14
simple mongo collection with mongohq
~ $ mongo -u USERNAME -p PASSWORD Flame.mongohq.com:27094/wereviewutah
MongoDB shell version: 1.6.5
connecting to: Flame.mongohq.com:27094/wereviewutah
> db.logs.find()
{ "_id" : ObjectId("4da0d8a5a130714ae1000023"), "count" : 1 }
> db.logs.findOne()
{ "_id" : ObjectId("4da0d8a5a130714ae1000023"), "count" : 1 }
> db.logs.update({}, {$inc:{count:1}})
> db.logs.findOne()
{ "_id" : ObjectId("4da0d8a5a130714ae1000023"), "count" : 2 }
@javisantana
javisantana / heroku_tornado.sh
Created June 15, 2011 14:41
tornado on heroku
virtualenv --no-site-packages .
source bin/activate
bin/pip install tornado
bin/pip freeze > requirements.txt
mkdir app
git init
cat >.gitignore <<EOF
bin/
include/
lib/
@vim-voom
vim-voom / markdown.vim
Created June 20, 2011 02:23
Markdown folding for Vim
" folding for Markdown headers, both styles (atx- and setext-)
" http://daringfireball.net/projects/markdown/syntax#header
"
" this code can be placed in file
" $HOME/.vim/after/ftplugin/markdown.vim
" In Markdown, setext-style overrides atx-style, so we first check for an
" underline. Empty lines should be ignored when underlined.
func! Foldexpr_markdown(lnum)
let l1 = getline(a:lnum)
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
sudo apt-get update
sudo apt-get upgrade
@sandys
sandys / T430S configuration
Last active December 21, 2017 00:25
super lean and fast Ubuntu 12.04 install. It doesnt hang and with firefox open, it consumes 500 mb of RAM ! - Now works with Ubuntu 14.04/Trusty Tahr!
# http://nodebox.metaforix.net/articles/debian-on-lenovo-thinkpad-t420
#create new file /usr/share/X11/xorg.conf.d/99-my.conf
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
@methylene
methylene / murmur.clj
Last active March 26, 2023 17:25
murmur hash in clojure
(def murmur
(let [m (com.google.common.hash.Hashing/murmur3_128)]
(fn ^Long [^String s]
(-> (doto (.newHasher m)
(.putString s com.google.common.base.Charsets/UTF_8))
(.hash)
(.asLong)))))