Skip to content

Instantly share code, notes, and snippets.

newthinker newthinker

Block or report user

Report or block newthinker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
newthinker /
Created Jun 6, 2016 — forked from zenorocha/
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description


TODO: Describe the installation process


newthinker /
Created Feb 23, 2016 — forked from sloria/
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


  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
newthinker / git-prune-tags.rb
Created Dec 18, 2015 — forked from rlivsey/git-prune-tags.rb
Script to prune any tags which exist locally but not on the remote
View git-prune-tags.rb
#!/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
newthinker /
Created Nov 29, 2015 — forked from jprante/
Range query example
curl -XDELETE 'localhost:9200/test'
curl -XPUT 'localhost:9200/test/data/1' -d '
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 /
Last active Aug 29, 2015
Recursion Algorithm
## Binary Search
def binary_search(data, target, low, high):
Return True if target is found in indicated portion of a data list.
The earch only considers the portion from data[low] to data[high] inclusive.
if low > high:
return False # interval is empty; no match
mid = (low+high)//2

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!

View Default (Linux).sublime-keymap
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" },
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" }
cat << EOF
usage: $0 [options] dbname
You can’t perform that action at this time.