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
DataframeSummary <- function(x) { | |
if (class(x) != "data.frame") | |
stop("must supply a dataframe") | |
#------------------------------------- | |
# Continuous, numeric data summaries | |
x.continuous <- x[ , sapply(x, is.numeric)] | |
if (ncol(x.continuous) > 0) { | |
x.min <- apply(x.continuous, 2, min, na.rm=TRUE) | |
x.max <- apply(x.continuous, 2, max, na.rm=TRUE) |
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
#!/usr/bin/perl -w | |
# Modified from Dr. Drang's original script at http://www.leancrew.com/all-this/2011/02/dissociated-darwin/ | |
use Games::Dissociate; | |
# Choose the corpus file | |
if ($#ARGV == -1) { | |
$corpus = "totc.txt"; | |
} else { | |
$corpus = $ARGV[0]; |
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
#!/usr/bin/env python | |
import os | |
import glob | |
import json | |
from datetime import datetime | |
import dateutil.parser | |
# Handle Unicode | |
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
Show hidden characters
{ | |
"word_separators": "/\\()\"'-:,;<>~!@#$%^&*|+=[]{}`~?" | |
} |
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
// Executes line(s) of text in REPL terminal, latter only displays code and does not execute | |
{ "keys": ["super+shift+r"], "command": "repl_transfer_current", "args": {"scope": "lines"}, "context": | |
[ | |
{ "operand": "source.r", "operator": "equal", "match_all": true, "key": "selector" } | |
] | |
}, |
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
def a_ask_b_to_join(): | |
print "Inviting B" | |
if b_delta_if_move >= 0 and b_delta_if_move > b_delta_if_stay: | |
print "This is the ideal situation; {0} will gain {1} points and {2} will gain {3}. Permission granted.".format(player_a.name, a_delta_if_stay, player_b.name, b_delta_if_move) | |
player_b.joinTeam(team_a) | |
return True | |
elif b_delta_if_stay >= 0 and b_delta_if_stay > b_delta_if_move: | |
print "It's better if B stays... but why not... join!" # TODO: Maybe base this on a percentage? | |
player_b.joinTeam(team_a) | |
return True |
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
repeat with bundleID in paragraphs of (do shell script "defaults read com.apple.dock persistent-apps | sed -E -n 's/.*\"bundle-identifier\" = \"(.*)\";/\\1/p'") | |
launch application id bundleID | |
set programName to name of application id bundleID | |
tell application "Finder" | |
set visible of process programName to false | |
end tell | |
end repeat |
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
#!/usr/bin/env bash | |
filename="${1}" | |
no_extension=${filename%.*} | |
# echo "Converting Markdown to LaTeX..." | |
# multimarkdown -t latex ${no_extension}.md > ${no_extension}.tex | |
echo "Running LaTeX..." | |
latex -interaction=nonstopmode ${no_extension} > /dev/null |
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
tell application "System Preferences" | |
activate | |
set the current pane to pane "Bluetooth" | |
delay 1 | |
end tell | |
tell application "System Events" | |
tell process "System Preferences" | |
set toggleBluetooth to the checkbox "Show Bluetooth in menu bar" of the window "Bluetooth" | |
click toggleBluetooth |
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
@article{econ-egypt-politics:2013, | |
Date-Added = {2013-04-04 23:27:11 +0000}, | |
Date-Modified = {2013-04-04 23:28:31 +0000}, | |
Day = {30}, | |
Entrysubtype = {magazine}, | |
Journal = {The Economist}, | |
Keywords = {790 Report}, | |
Month = {3}, | |
Title = {Egypt: It's the politics, stupid}, | |
Url = {http://www.economist.com/news/leaders/21574495-economy-faces-collapse-broader-based-government-needed-take-tough-decisions-its}, |