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
Step One | |
Fetch URL based on column: | |
'http://www.datasciencetoolkit.org/maps/api/geocode/json?sensor=false&address=' + escape(value, 'url')' | |
Step Two | |
Parse Json for longitude: | |
value.parseJson()["results"][0]["geometry"]["location"]["lng"] |
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
# From http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html | |
export MARKPATH=$HOME/.marks | |
function jump { | |
cd -P $MARKPATH/$1 2> /dev/null || echo "No such mark: $1" | |
} | |
function mark { | |
mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1 | |
} | |
function unmark { | |
rm -i $MARKPATH/$1 |
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
[ -e ~/.ssh/id_rsa.pub ] || ssh-keygen -f ~/.ssh/id_rsa | |
pbcopy < ~/.ssh/id_rsa.pub |
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_STR(" | |
library('ggmap'); | |
geo <- geocode(.arg1, output='latlon'); | |
geo$latlon <- do.call(paste, c(geo[c('lat','lon')], sep = ',')); | |
geo$latlon | |
", ATTR([FULL ADDRESS])) |
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
brew install saltstack | |
sudo mkdir -p /etc/salt /var/cache/salt /var/log/salt | |
sudo chown -R leach /etc/salt /var/cache/salt /var/log/salt |
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
MAX(IFF([Category]="category1",1,0))+ | |
MAX(IFF([Category]="category2",1,0))=2 |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<body> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script> | |
var width = 960, | |
height = 500; | |
var nodes = d3.range(200).map(function() { return {radius: Math.random() * 12 + 4}; }), |
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
DATEPARSE("yyyy", STR(year) ) |
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_REAL(" | |
xdata <- .arg1 | |
ydata <- .arg2 | |
indices <- which( abs(ydata) < 0.01 ) | |
ndata <- length( ydata ) | |
weights <- rep(1, ndata) | |
weights[indices] = 0 | |
model <- lm( ydata ~ xdata + I(xdata^2), weights=weights ) |
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_STR('classify_polarity(.arg1,algorithm="bayes",verbose=TRUE)[,4]', | |
ATTR([CommentText]) | |
) | |
SCRIPT_STR('classify_emotion(.arg1,algorithm="bayes",verbose=TRUE)[,7]', | |
ATTR([CommentText]) | |
) |