Skip to content

Instantly share code, notes, and snippets.

View organisciak's full-sized avatar

Peter Organisciak organisciak

View GitHub Profile
# Setup Git global preferences
## Aliases
### Git up: a ff-only version of merge
### See: http://stackoverflow.com/questions/15316601/in-what-cases-could-git-pull-be-harmful
git config --global alias.up '!git remote update -p; git merge^ --ff-only @{u}'
### Git wiff
### "git diff --word-diff" >always used when writing
git config --global alias.wiff 'diff --word-diff'
// Note, parts of this code are based on the default ubiquity commands
function getJSONArray(url, callback) {
jQuery.getJSON(url,
function (data) {
callback(data);
});
}
function getCSVArray(url, callback) {
Utils.ajaxGet(url, function(data) {
@organisciak
organisciak / basic-accuser.txt
Last active October 26, 2015 17:26
Tracery Examples
{
"origin": ["I accuse #suspect# of committing the crime in the #room# with the #weapon#!"],
"suspect": ["Miss Scarlett", "Colonel Mustard", "Mrs. White", "Reverend Green", "Mrs. Peacock", "Professor Plum", "Miss Peach", "Monsieur Brunette", "Madame Rose", " Sergeant Gray"],
"room": ["kitchen", "ballroom", "conservatory", "dining room", "billiard room", "library", "study", "hall", "lounge"],
"weapon": ["candlestick", "knife", "lead pipe", "dagger", "revolver", "rope", "wrench"]
}
@organisciak
organisciak / post-commit
Created December 16, 2015 00:23
githook to convert iPython README to Markdown
READPY=$(git log --name-only HEAD^.. | grep "^README.ipynb$")
READMD=$(git log --name-only HEAD^.. | grep "^README.md$")
if [ -n "$READPY" ] && [ -z "$READMD" ]; then
echo "It looks like a new README was committed, appending a Markdown version"
ipython nbconvert --to markdown README.ipynb
# Adding this file doesn't work in pre-commit hooks, which is
# why we're appending post-commit
git add README.md
@organisciak
organisciak / rankedngrams.json
Last active December 19, 2015 03:49
Top 10000 words in the English language, merged (case-insensitive)
{"the":569,"of":544,"in":536,"and":529,"to":516,"for":482,"on":481,"by":478,"it":468,"at":465,"with":458,"as":452,"is":452,"an":451,"from":450,"new":442,"no":437,"not":433,"a":411,"this":411,"or":410,"all":410,"they":407,"when":407,"there":406,"one":406,"if":404,"these":400,"some":399,"you":399,"but":399,"that":398,"we":398,"what":397,"after":396,"so":393,"he":393,"how":391,"while":388,"then":387,"first":385,"even":384,"two":384,"their":383,"now":382,"our":380,"his":379,"many":379,"here":377,"because":377,"before":377,"another":376,"where":374,"do":373,"most":373,"only":370,"each":369,"every":367,"more":367,"those":367,"may":366,"such":365,"both":365,"since":361,"just":361,"like":360,"other":359,"see":359,"my":358,"who":358,"three":357,"why":357,"once":357,"are":356,"without":355,"can":354,"its":352,"let":352,"during":351,"great":349,"good":348,"about":346,"she":346,"however":346,"did":345,"any":345,"well":344,"under":342,"yet":342,"again":342,"be":341,"time":340,"will":340,"still":338,"have":338,"through":33
@organisciak
organisciak / .vimrc
Last active December 23, 2015 11:39
My .vim settings.
" Set leader to ,
let mapleader=","
" Run Vim Pathogen https://github.com/tpope/vim-pathogen
execute pathogen#infect()
" Coffee Script Indentation
au BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab softtabstop=2
" Coffeescript fold by indent (use 'zi' to fold)
au BufNewFile,BufReadPost *.coffee setl foldmethod=indent nofoldenable