Skip to content

Instantly share code, notes, and snippets.

View gorakhargosh's full-sized avatar

Yesudeep Mangalapilly gorakhargosh

View GitHub Profile
@Jxck
Jxck / rob.go
Last active November 17, 2022 20:34
gocon 2014
type errWriter struct {
w io.Writer
err error
}
func (e *errWriter) Write(p []byte) {
if e.err != nil {
return
}
_, e.err = e.w.Write(p)
@fujimogn
fujimogn / homebrew.mxcl.pdnsd.plist
Created August 20, 2012 06:01
Installing pdnsd from Homebrew

Installing pdnsd from homebrew as root user.

$ brew install pdnsd

$ sudo chown -R nobody /usr/local/var/cache/pdnsd

$ curl -L http://goo.gl/kMlyQ -o pdnsd.conf
$ mv pdnsd.conf /usr/local/etc
$ sudo chown root /usr/local/etc/pdnsd.conf
@dbarnett
dbarnett / jsonalchemy.py
Created February 3, 2012 15:10
JSONAlchemy: Proper JSON marshalling and mutation tracking in SQLAlchemy
import simplejson
import sqlalchemy
from sqlalchemy import String
from sqlalchemy.ext.mutable import Mutable
class JSONEncodedObj(sqlalchemy.types.TypeDecorator):
"""Represents an immutable structure as a json-encoded string."""
impl = String
@gjcourt
gjcourt / query_parser.py
Created July 27, 2011 20:57
One line query string parser (@dcramer)
dict((k, v[0] if len(v) == 1 else v) for k, v in [(k, [z[1] for z in v]) for k, v in itertools.groupby(sorted([x.split('=') for x in qs.split('&')], key=lambda x: x[0]), key=lambda x: x[0])])