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
# bash/zsh git prompt support | |
# # -*- encoding: utf-8 -*- | |
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org> | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# This script allows you to see repository status in your prompt. | |
# | |
# To enable: | |
# | |
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh). |
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
function! Command_T_Local() "Go to the root of the git repo, then CommandT | |
"Ask git for the root of the git repo (as a relative '../../' path) | |
let git_top = system('git rev-parse --show-cdup') | |
let git_fail = 'fatal: Not a git repository' | |
if strpart(git_top, 0, strlen(git_fail)) == git_fail | |
" Above line says we are not in git repo. Ugly. Better version? | |
call Command_T_Work() | |
else | |
" Move working dir to root of repo, then CommandT | |
execute ":cd ./" . git_top |
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
" http://j.mp/dotvimrc | |
nn gt : exec tabpagenr('$') == 1 ? 'bn' : 'tabnext'<CR> | |
nn gT : exec tabpagenr('$') == 1 ? 'bp' : 'tabprevious'<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
Create remote called heroku | |
> git remote add heroku git@heroku.com:YOURAPPNAME.git | |
create a local tracking branch called heroku | |
> git checkout -b heroku -t heroku/master | |
This will checkout the last revision you deployed to Heroku. | |
Now tell git to push the heroku branch to heroku/master |
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
" Using "g*" does two things differently from the normal "*": | |
" | |
" - Doesn't move the cursor, simply sets the match | |
" - When moving the cursor with "n" and "N", positions it where it was on the original word. | |
" | |
" Note: g* is ordinarily taken, see :help g* | |
" | |
nnoremap g* :call <SID>SmartStar()<cr> | |
function! s:SmartStar() |
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
# .ycm_extra_conf.py for vim source code. This should work after running './configure | |
import os, re | |
def create_flags(): | |
rv = [ | |
'-Wall', | |
'-Wextra', | |
'-std=c89', | |
'-x', |
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
" Highlight a word from inside vim. The color is chosen at random but | |
" persisted across sessions. | |
" By Kartik Agaram -- http://akkartik.name -- ondemandhighlight@akkartik.com | |
" Experimenting with an idea by Evan Brooks: https://medium.com/p/3a6db2743a1e | |
" Discussion: http://www.reddit.com/r/programming/comments/1w76um/coding_in_color | |
let highlight_file = &viewdir."/highlights" | |
if !filereadable(highlight_file) | |
call system("mkdir -p ".&viewdir) |
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 pytest | |
@pytest.fixture(scope='session') | |
def _django_db_setup(request, _django_db_setup, _django_cursor_wrapper): | |
"""Load any data needed for the tests after the database is created. | |
This "overwrites" pytest_django's own _django_db_setup. | |
""" |
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
#!/usr/bin/env python | |
import sys | |
import pprint | |
def displayhook_pprint(o): | |
"""Display hook powered by pprint. | |
https://www.python.org/dev/peps/pep-0217/ |
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
#!/usr/bin/env python | |
# symlink a system package or module into the current virtual env | |
import logging | |
import optparse | |
import os | |
import sys | |
import shutil | |
import subprocess | |
import pickle |
OlderNewer