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
One handy hook I use is to overwrite some shell buildins. For example I have a custom cd, you can do so much with totally localized environments. | |
proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}') | |
#this function will overwrite the default behavior of cd to go to the root of the venv, to go to HOME use cd ~ | |
#change postdeactivate as well if you use this hook to revert cd back to ~ | |
cd () { | |
if (( $# == 0 )) | |
then | |
builtin cd ~/projects/$proj_name | |
else |
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
#add these lines to your .virtualenv/postactivate | |
#also add the cscope_maps.vim file at https://gist.github.com/3862602 to .vim/plugin/ | |
#find $VIRTUAL_ENV/lib/python2.7/site-packages ${PWD} -name '*.py' > $VIRTUAL_ENV/cscope.files && cscope -R #-b -q -f $VIRTUAL_ENV/cscope.out -i $VIRTUAL_ENV/cscope.files | |
#(original cscope function) | |
nohup find ${PWD} -name '*.py' > $VIRTUAL_ENV/cscope.files && pycscope -f $VIRTUAL_ENV/cscope.out -i $VIRTUAL_ENV/cscope.files & disown | |
CSCOPE_DB=$VIRTUAL_ENV/cscope.out; export CSCOPE_DB |
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
ctags -f $VIRTUAL_ENV/tags -R $VIRTUAL_ENV/lib/python2.7/site-packages ${PWD} &> /dev/null & disown |
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
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" CSCOPE settings for vim | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" | |
" This file contains some boilerplate settings for vim's cscope interface, | |
" plus some keyboard mappings that I've found useful. | |
" | |
" USAGE: | |
" -- vim 6: Stick this file in your ~/.vim/plugin directory (or in a | |
" 'plugin' directory in some other directory that is in your |
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://jeetworks.org/node/145 |
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
_ _ _ ___ _ _ _ _ | |
/_\ | |_ __ ___ __| |_ / _ \| |__ ___ ___| |___| |_ ___ _ _ ___| |_ | |
/ _ \| | ' \/ _ (_-< _| (_) | '_ (_-</ _ \ / -_) _/ -_)_| ' \/ -_) _| | |
/_/ \_\_|_|_|_/__/|/|_.__/__//_|\___\___|\__| | |
In Glorious ASCII-VISION | |
Home | |
2011-04-17 Sun Using Rope or Ropemacs with Python Virtualenv | |
To make Rope use the libraries in your virtualenv: edit config.py in the .ropeproject directory (in the Rope project you want to set this up for) and add the following lines at the top of the "set_prefs" function: |
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
CAPTAIN, I CAN SEE | |
THE rm -rf /usr LAND! | |
_____|\ . | |
_.--| LOL |: \O.===o | |
<____|.----|| ||` | |
.---''--;; | |
The ;..__..' _... | |
Lulz ,'/ ;|/..--'' \ | |
Boat ,'_/.-/': : | |
_..-'''/ / | \ \ _|/| |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
typedef unsigned int u32; | |
typedef unsigned long long u64; | |
//------------------------------------------------------------------------- | |
// WorkArea | |
//------------------------------------------------------------------------- |
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
# -*- coding: utf-8 -*- | |
from django import forms | |
from crispy_forms.helper import FormHelper | |
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field | |
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions | |
class MessageForm(forms.Form): | |
text_input = forms.CharField() |
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
#!/bin/bash | |
cd ./$(git rev-parse --show-cdup) | |
result=$(mktemp /tmp/pre-commit.XXXXX) | |
STAGED=${STAGED:---staged} | |
changed_py=$(git diff --name-only --diff-filter=AM $STAGED | grep -E '\.py$') | |
changed_js=$(git diff --name-only --diff-filter=AM $STAGED | grep -E '\.js$') | |
[[ -z $changed ]] && exit 0 |
OlderNewer