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
;; ==================================== | |
;; Packages | |
(setq repository-packages | |
'( | |
auto-complete | |
ac-html | |
feature-mode | |
markdown-mode | |
php-mode |
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
# extract a distributable archive, with changed files only (archive name derived from directory name and date): | |
alias git-diff="git diff --name-only HEAD^1 HEAD | zip ../${PWD##*/}-`date +%Y%m%d`-diff.zip -@" | |
# archive the current state: | |
alias git-archive="git archive --format=zip HEAD >../${PWD##*/}-`date +%Y%m%d`.zip" | |
# silence annoying CLRF warnings with: | |
git config --global core.autocrlf false | |
# remember credentials |
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
# enforce UTF-8 even if defaultencoding says 'ascii' | |
export PYTHONIOENCODING=utf-8 | |
# make sure pip only works in a virtualenv | |
export PIP_REQUIRE_VIRTUALENV=true | |
# unless... | |
gpip() { | |
PIP_REQUIRE_VIRTUALENV="" pip "$@" | |
} |
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
if app.debug: | |
if environ.get("WERKZEUG_RUN_MAIN") == "true": # check to prevent "Address already in use" | |
import ptvsd | |
ptvsd.enable_attach("my_secret") |
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://docs.sqlalchemy.org/en/latest/faq/ormconfiguration.html#how-do-i-get-a-list-of-all-columns-relationships-mapped-attributes-etc-given-a-mapped-class | |
from sqlalchemy import inspect | |
from models import * | |
mapper = inspect(Task) | |
for f in 'attrs column_attrs relationships all_orm_descriptors columns'.split(): | |
print '%s:'% f | |
for x in getattr(mapper, f): | |
print ' %s' % 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
''' This script takes the Radio 2 Top 2000 (http://www.nporadio2.nl/top2000) | |
and analyses artist performance: | |
- count: number of occurences of artist in list | |
- score: number of points (#1 song gets 2000 point, #2 song gets 1999 etc.) | |
store input file as CSV with ;-delimiter in 'TOP-2000-2015.csv' | |
''' | |
import csv | |
import sys |
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
""" script to add level numbering to alias of EA requirements | |
get csv from EA with the query below: | |
select Object_ID, ParentID, Name, Alias, Version, Effort, Phase, TPos | |
from t_object where Object_Type="Requirement" | |
""" | |
import csv | |
import sys |