This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exec '%s/'.getline('.')[col('.')-1].getline('.')[col('.')].getline('.')[col('.')+1].'//g' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import os | |
STORING_TO_CSV = False | |
if 'STORE_TO_CSV' in os.environ: | |
facilities_csv = csv.writer(open('thd_facilities.csv', 'w')) | |
inspections_csv = csv.writer(open('thd_inspections.csv', 'w')) | |
STORING_TO_CSV = True | |
print "Storing to CSV" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class db | |
{ | |
protected static $dbh = false; | |
public function connect($dsn = null) | |
{ | |
self::$dbh = new PDO($dsn); | |
self::$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mapleader = "," | |
filetype plugin indent on | |
set t_Co=256 | |
colorscheme lucius | |
set nocompatible | |
set autoindent | |
set tabstop=4 | |
set softtabstop=4 | |
set shiftwidth=4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Gist | |
let g:gist_clip_command='pbcopy' | |
let g:gist_detect_filetype=1 | |
nnoremap <silent> <Leader>V :'<,'>Gist<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Gist | |
let g:gist_clip_command='pbcopy' | |
let g:gist_detect_filetype=1 | |
nnoremap <silent> <Leader>V :'<,'>Gist<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ### EJSTemplate | |
// | |
// Template executed using EJS | |
var EJSTemplate = ks_utils.Class(BaseTemplate, { | |
initialize: function (options) { | |
BaseTemplate.prototype.initialize.apply(this, arguments); | |
var ejs = require('ejs'); | |
util.debug("EJSTemplate.initialize, source: " + util.inspect(this.options.source)); | |
this.compiled = ejs.compile(this.options.source); | |
util.debug("EJSTemplate.initialize, compiled: " + util.inspect(this.compiled)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# monkey-patch django loaddata to ignore foreign key checks | |
from django.core.management.commands.loaddata import Command | |
from django.db import connections, DEFAULT_DB_ALIAS | |
def uses_mysql(connection): | |
return 'mysql' in connection.settings_dict['ENGINE'] | |
_old_handle = Command.handle | |
def _foreign_key_ignoring_handle(self, *fixture_labels, **options): | |
"""Wrap the the stock loaddata to ignore foreign key checks so we can load | |
circular references from fixtures. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"meta": { | |
"limit": 20, | |
"next": null, | |
"offset": 0, | |
"previous": null, | |
"total_count": 1 | |
}, | |
"objects": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' | |
lol = log --graph --decorate --pretty=oneline --abbrev-commit | |
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all |
OlderNewer