Skip to content

Instantly share code, notes, and snippets.

@newthinker
newthinker / README.md
Created June 6, 2016 02:32 — forked from zenorocha/README.md
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@newthinker
newthinker / bobp-python.md
Created February 23, 2016 09:59 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@newthinker
newthinker / git-prune-tags.rb
Created December 18, 2015 02:14 — forked from rlivsey/git-prune-tags.rb
Script to prune any tags which exist locally but not on the remote
#!/usr/bin/env ruby
require 'readline'
def prompt(prompt="> ")
input = nil
prompt += " " unless prompt =~ /\s$/
loop do
input = Readline.readline(prompt)
break if input.length > 0
end
@newthinker
newthinker / rangequery.sh
Created November 29, 2015 14:21 — forked from jprante/rangequery.sh
Range query example
curl -XDELETE 'localhost:9200/test'
curl -XPUT 'localhost:9200/test/data/1' -d '
{
"numbers":[11,23,13,16,17,23.6]
},
'
import collections
import json
import redis
import threading
from tornado import gen
from tornado import ioloop
from tornado import web
from tornado.options import define
from tornado.options import options
import tornadoredis
@newthinker
newthinker / tree.md
Created December 5, 2013 10:54 — forked from hrldcpr/tree.md

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

[
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" },
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" }
]
#!/bin/bash
LOADING=false
usage()
{
cat << EOF
usage: $0 [options] dbname
OPTIONS: