Skip to content

Instantly share code, notes, and snippets.

View aufrank's full-sized avatar

Austin F. Frank aufrank

  • Riot Games
  • St. Louis, MO
View GitHub Profile
@aufrank
aufrank / mapping_trouble.clj
Created September 7, 2011 17:57
mapping trouble
(defrecord Node [^Float activation neighbors])
(def k (Node. 0.2 '(kaet)))
(def ae (Node. 0.2 '(kaet)))
(def t (Node. 0.2 '(kaet)))
(def kaet
(Node. 0.2 '(k ae t cat)))
(def cat (Node. 0.2 '(kaet)))
(map #(:activation %) (:neighbors kaet))
@aufrank
aufrank / gist:1167266
Created August 24, 2011 03:47 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
Day job: Cognitive science post-doc
Favorite Python project: PsychoPy https://github.com/psychopy/psychopy
Favorite Conference: International Workshop on Language Production
Python Experience Level: Intermediate
[diff]
tool = chdiff
[difftool]
prompt = false
[difftool "chdiff"]
cmd = /usr/bin/env chdiff "$LOCAL" "$REMOTE"
library(rms)
library(ggplot2)
ddiamonds <- datadist(diamonds)
options(datadist = "ddiamonds")
fit.ols <- ols(price ~ carat * cut, diamonds)
## can specify a range on a continuous predictor
Predict(fit.ols, carat = seq(2,4,.25))
## can specify a single level for a categorical predictor
(defun mark-line (&optional arg)
(interactive "p")
(beginning-of-line)
(let ((here (point)))
(dotimes (i arg)
(end-of-line))
(set-mark (point))
(goto-char here)))
(defun mark-sentence (&optional arg)
'(ido-auto-merge-work-directories-length 0)
'(ido-cannot-complete-command (quote ido-exit-minibuffer))
'(ido-decorations (quote ("{" "}" "," ",..." "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]")))
'(ido-enable-flex-matching t)
'(ido-ignore-files (quote ("\\`CVS/" "\\`#" "\\`.#" "\\`\\.\\./" "\\`\\./" "\\`\\.DS_Store" "\\`\\.localized")))
'(ido-mode (quote both) nil (ido))
'(ido-use-filename-at-point nil)
'(ido-use-virtual-buffers t)
#!/bin/sh
# The job of git-flush is to recompactify your repository to be as small
# as possible, by dropping all reflogs, stashes, and other cruft that may
# be bloating your pack files.
git for-each-ref --format="%(refname)" refs/original/ | \
xargs -n 1 git update-ref -d
git reflog expire --expire=0 --all
(defun epom-insinuate-todochiku ()
"Use the notification functions from todochiku.el."
(mapc (lambda (args)
(let ((hook (car args))
(message (nth 1 args))
(icon (nth 2 args))
(old-function (nth 3 args)))
(epom-add-todochiku-hook hook message icon)
(epom-remove-hook hook old-function)))
'((epom-start-pom-hook
# shows things that might be invisibly messing up a script, like DOS
# line endings
cat -vet file
@aufrank
aufrank / git-prompt-dirty.sh
Created March 23, 2009 15:06 — forked from yannk/.bashrc.sh
as seen in yannk++, but remove debian-specific stuff
# add in your .bashrc
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# http://blog.cyberion.net/2009/01/improved-bash-prompt-for-git-usage.html
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master⚡]$ # dirty working directory
#
# I've made the following ajustements:
# - Use of plumbing, that should be faster than git status porcelain.
# - Don't show my repo as dirty if it has files unknown from the index (I always have).