Skip to content

Instantly share code, notes, and snippets.

View dguaraglia's full-sized avatar

David Guaraglia dguaraglia

  • MerQube
  • Minnesota
View GitHub Profile
/*
* override Underscore's template syntax with Django-style syntax
*/
_.templateSettings = {
interpolate : /\{\{(.+?)\}\}/g,
evaluate: /\{%(.+?)%\}/g,
};
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
" 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()
# 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'])
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
$ 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'>
class Backend(object):
def do_something(self):
raise NotImplemented()
class EtcdBackend(Backend):
def do_something(self):
... # do some actual work
# Runtime images
FROM python:3.8.8-slim as runtime
EXPOSE 8000
COPY . /app/
RUN mkdir -p /app/static/js
WORKDIR /app
RUN pip install -r requirements.txt
RUN python manage.py collectstatic --no-input --no-color
CMD gunicorn crohn.wsgi:application -w 2 -b :8000