Skip to content

Instantly share code, notes, and snippets.

Avatar

David Guaraglia dguaraglia

View GitHub Profile
View baseclass.py
class Backend(object):
def do_something(self):
raise NotImplemented()
class EtcdBackend(Backend):
def do_something(self):
... # do some actual work
View gist:e7f7c875b4f82be330d4013764f923d8
$ python2.7 2 ↵
Python 2.7.13 (default, Aug 7 2017, 19:25:44)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> s = b"somechars"
>>> type(s)
<type 'str'>
>>> c = s[3]
>>> type(c)
<type 'str'>
View tmux.conf
set -g terminal-overrides "xterm*:XT:smcup@:rmcup@"
set -g default-terminal "screen-256color"
# Other theme
set -g status-left-length 32
set -g status-right-length 150
set -g status-fg white
set -g status-bg colour234
set -g window-status-activity-attr bold
View 2010-10-02-14-00-test-migration.py
# 2010-10-02 14h00
# Update created field in user_prefs table
def migrate(db):
with db.select('user_id, created', from_='users'):
all_users = db.fetchall()
for user in all_users:
with db.update('user_prefs') as obj:
obj.created = user['created']
db.where('user_id = %s', user['user_id'])
View vimrc
" Use pathogen to easily modify the runtime path to include all
" plugins under the ~/.vim/bundle directory
filetype off
let g:jedi#show_function_definition = 0
let g:jedi#popup_select_first = 0
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
View vim configuration
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 12 2013 14:31:13)
MacOS X (unix) version
Compiled by Homebrew
Huge version with MacVim GUI. Features included (+) or not (-):
+arabic +cscope +float +listcmds +mouse_xterm +reltime +terminfo +windows
+autocmd +cursorbind +folding +localmap +multi_byte +rightleft +termresponse +writebackup
+balloon_eval +cursorshape -footer -lua +multi_lang +ruby +textobjects -X11
+browse +dialog_con_gui +fork() +menu -mzscheme +scrollbind +title -xfontset
++builtin_terms +diff +fullscreen +mksession +netbeans_intg +signs +toolbar +xim
+byte_offset +digraphs -gettext +modify_fname +odbeditor +smartindent +transparency -xsmp
View undesrcore config.js
/*
* override Underscore's template syntax with Django-style syntax
*/
_.templateSettings = {
interpolate : /\{\{(.+?)\}\}/g,
evaluate: /\{%(.+?)%\}/g,
};
You can’t perform that action at this time.