Skip to content

Instantly share code, notes, and snippets.

View joyrexus's full-sized avatar

J. Voigt joyrexus

View GitHub Profile
@joyrexus
joyrexus / timing.coffee
Created June 27, 2013 19:19
Show the time-related info for a leap gesture sample (frames, secs, FPS)
#!/usr/bin/env coffee
#
# Show the time-related info for a leap gesture sample:
#
# frames - number of frames
# seconds - number of seconds
# FPS - frames per second
#
# Usage:
#
@joyrexus
joyrexus / ip.sh
Created July 11, 2013 16:10
Two commands to print your active IP address.
ipconfig getifaddr en0 # or en1 for wireless
ifconfig | grep "inet " | grep -v "127.0" | cut -d' ' -f 2
@joyrexus
joyrexus / README.md
Last active December 19, 2015 18:08
Simple example of class & instance variables and fat arrow usage.

CoffeeScript Classes

A simple example demonstrating use of static & instance variables and the fat arrow (=>).

Static vs Instance Variables

CS stores static properties and methods on the class itself, not on the prototype. Hence, class variables do not conflict with identically named instance variables.

@joyrexus
joyrexus / diff.sql
Created July 16, 2013 21:18
#ldp | Show counts of utts that differ from primary dataset by subj/sess.
-- show counts of utts that differ from primary dataset by subj/sess
--
-- sqlite3 < diff.sql
-- subject session count(*)
-- 39 11 900
-- 55 12 510
-- 77 12 738
-- 100 12 5
ATTACH 'temp.db' AS new;
@joyrexus
joyrexus / sql.vim
Created July 16, 2013 21:22
#vim | Quickly run sql queries w/in vim. (~/.vim/ftplugin/sql.vim)
map <LocalLeader>r :!sqlite3 < %<CR>
@joyrexus
joyrexus / ldp_transcript.md
Last active March 3, 2016 18:22
Dump an LDP transcript from the sqlite datastore

Dump an LDP transcript

Suppose you want to dump a few columns from the transcript for seventh visit to subject 22 in our study ... say the columns containing for both parent and child utterances) to view them in Excel or Google Docs:

LDP_DB=$LDP/data/ldp.db

sqlite3 -header -separator "<TAB>" $LDP_DB 'SELECT id, time, p_utts, c_utts FROM utterances WHERE session=7 AND subject=22' > 22.07.xls

To insert a tab character type CONTROL + V then T. (That is, hold down the control key with the V key, followed by T.)

@joyrexus
joyrexus / queries.md
Last active January 26, 2016 23:02
Overview and examples of querying the LDP dataset.

LDP Queries

An overview and a few example of how to query the LDP dataset for those with local copies of the sqlite datastore but unfamiliar with SQL as a query language.


To dump a few columns from a specific transcript, see this gist.

If you're an R user, there's a sqlite interface called RSQLite, which makes it pretty easy to build "data frames" with selections straight from the LDP dataset (assuming you have your local copy of the dataset in a sqlite database).

@joyrexus
joyrexus / prompt.sh
Last active December 19, 2015 22:59
Git-enhanced prompt and tab-completion for bash.
. /usr/local/etc/bash_completion # tab completion
. /usr/local/etc/bash_completion.d/git-prompt.sh # git-enhanced prompt
GREEN="\[\033[0;32m\]"
ORANGE="\[\033[0;33m\]"
BLUE="\[\033[0;34m\]"
RESET="\[\033[0m\]"
PS1="${GREEN}\w${BLUE}\$(__git_ps1 ':%s')${ORANGE}⚡${RESET} " # show git branch
@joyrexus
joyrexus / bash_profile
Last active December 19, 2015 23:08
Revised bash profile.
# Standard shell environment
GREEN="\[\033[0;32m\]"
ORANGE="\[\033[0;33m\]"
BLUE="\[\033[0;34m\]"
RESET="\[\033[0m\]"
. /usr/local/etc/bash_completion # tab completion
. /usr/local/etc/bash_completion.d/git-prompt.sh # git-enhanced prompt
@joyrexus
joyrexus / git.cheat
Created July 31, 2013 14:52
Git cheat sheet.
Setup
-----
git clone <repo>
clone the repository specified by <repo>; this is similar to "checkout" in
some other version control systems such as Subversion and CVS
Add colors to your ~/.gitconfig file:
[color]