Skip to content

Instantly share code, notes, and snippets.

View ShawnMilo's full-sized avatar

Shawn Milochik ShawnMilo

View GitHub Profile
@ShawnMilo
ShawnMilo / tellme
Created April 2, 2013 18:37
sample of a blog post in restructured text
tellme
======
:date: 2013-04-02
:tags: computing, Ubuntu
:category: computing
:slug: tellme
:author: Shawn Milochik
:email: shawn@milochik.com
:summary: "tellme" when you're done
from hashlib import sha512
from uuid import uuid4
from redis import StrictRedis
__all__ = (
'hash_password', 'create_user', 'login_is_valid',
)
conn = StrictRedis()
@ShawnMilo
ShawnMilo / foe.go
Created January 6, 2015 20:08
foe. A file search that opens the files found in vim.
package main
import (
"bufio"
"flag"
"log"
"net/http"
"os"
"os/exec"
"path/filepath"
@ShawnMilo
ShawnMilo / ff.go
Created January 6, 2015 20:06
file finder: Basically a handy replacement for: find . -name '*foo*'
package main
import (
"flag"
"fmt"
"log"
"os"
"path/filepath"
"strings"
)
#!/usr/bin/env python
"""
Identify (and potentially delete) remote branches which have already
been merged into the current branch.
It works by using the "git merge-base" command to see if the other branch's
newest commit is already contained in the current branch.
Run normally it does nothing destructive. It will just list branches that
diff --git README.md README.md
index a8f9e20..2426c57 100644
--- README.md
+++ README.md
@@ -2,26 +2,26 @@
[![Build Status](https://travis-ci.org/siddontang/ledisdb.svg?branch=develop)](https://travis-ci.org/siddontang/ledisdb)
-Ledisdb is a high performance NoSQL like Redis written by go. It supports some data structure like kv, list, hash, zset, bitmap,set.
+Ledisdb is a high-performance NoSQL database, similar to Redis, written in [Go](http://golang.org/). It supports many data structures including kv, list, hash, zset, bitmap,set.
diff --git migrate.go migrate.go
index 2659631..0ff1ada 100644
--- migrate.go
+++ migrate.go
@@ -22,6 +22,14 @@ const (
Down
)
+var tableName = "gorp_migrations"
+
@ShawnMilo
ShawnMilo / ip2zip.go
Last active August 29, 2015 14:02
Convert IP to zip & country code via MaxMind (GeoLite) data in RAM, no DB Required. Proof of concept.
package main
import (
"encoding/csv"
"encoding/json"
"fmt"
"io"
"log"
"math"
"net/http"

Keybase proof

I hereby claim:

  • I am ShawnMilo on github.
  • I am shawnmilo (https://keybase.io/shawnmilo) on keybase.
  • I have a public key whose fingerprint is CA9E 61AD 5D8A 1DAF 2354 EFED BD07 0528 6606 5487

To claim this, I am signing this object:

"""
Clean up unnecessary whitespace in a file.
Also fix tabs-to-spaces.
"""
# Must be called from within vim; can't run stand-alone.
import vim
def remove_trailing_spaces(buff):
"""