Skip to content

Instantly share code, notes, and snippets.

dbarnett / .vimrc
Created Mar 28, 2020
Sample minimal .vimrc for reproducing vim-codefmt bug xyz
View .vimrc
call plug#begin('~/.vim/plugged')
Plug 'google/vim-maktaba'
Plug 'google/vim-codefmt'
Plug 'google/vim-glaive'
call plug#end()
call glaive#Install()
Response to
If you're going to enumerate each "missing method" and its args, why not just
define a stub?
class Twython(object):
def __init__(self, params):
dbarnett / pip_anyjson.trace
Created Feb 26, 2012
snippet from python -m trace --trace pdb install dist/anyjson-0.3.1.tar.gz
View pip_anyjson.trace
This file has been truncated, but you can view the full file.
--- modulename: req, funcname: prepare_files unnamed = list(self.unnamed_requirements) reqs = list(self.requirements.values())
--- modulename: req, funcname: values values_list = [] for key in self._keys: return values_list while reqs or unnamed: if unnamed:
dbarnett /
Created Feb 11, 2012
Object-oriented demonstration for SO question
import random
class Vehicle(object):
def __init__ (self, _id): = None = _id
def printDoors(self):
print 'Car ' + str( + ' has ' + str(self.doors) + ' doors.'
dbarnett /
Created Feb 3, 2012
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
#!/usr/bin/env python
import glob
import os
import setuptools
import sys
import types
def show_all_files(*args, **kw):
# package files