Skip to content

Instantly share code, notes, and snippets.

@datawookie
datawookie / dated-backup.sh
Last active November 7, 2018 09:44
Created a dated version of a file and persist on S3.
#!/bin/bash
# Created a dated version of a file and persist on S3.
#
# Usage:
#
# dated-backup.sh file-to-backup.txt s3://name-of-bucket/
FILE=$1
BUCKET=$2
functions { # User-defined functions [Optional]
}
data { # Data (external) [Optional]
}
transformed data { # Preprocess data [Optional]
}
parameters { # Model parameters (must precede model) [Mandatory]
}
transformed parameters { # Preprocess parameters [Optional]
@datawookie
datawookie / Productivity Hacks - Buffon Needle.md
Last active March 17, 2018 03:43
Files for Productivity Hacks talk.

Some files for talk about Productivity Hacks.

Setup:

Launch a t2.2xlarge instance (8 cores) on AWS.

  1. Start a tmux session. Create two horizontal panes (Ctrl-b ").
  2. sudo apt update && sudo apt install -y htop r-base
  3. wget -O buffon-needle.R http://bit.ly/2HieqWc
@datawookie
datawookie / Productivity Hacks - Travelling Salesman.md
Last active February 19, 2018 12:36
Files for Productivity Hacks talk.

Some files for talk about Productivity Hacks.

@datawookie
datawookie / digg_reader_subscriptions.xml
Created November 30, 2017 08:59
RSS Feeds (in OPML)
<?xml version="1.0" encoding="UTF-8" ?>
<opml version="1.0">
<head>
<title>Andrew B. Collier subscriptions in Digg Reader</title>
</head>
<body>
<outline text="Hyndsight" title="Hyndsight" type="rss" xmlUrl="http://feeds.feedburner.com/ProfessorRobJHyndman" htmlUrl="http://robjhyndman.com" /></body>
</opml>
@datawookie
datawookie / truffle.js
Last active November 19, 2017 06:50
Truffle configuration (for testrpc)
// Configuration for testrpc.
//
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*",
gas: 4000000
}
@datawookie
datawookie / truffle.js
Last active November 19, 2017 06:48
Truffle configuration (for truffle console)
// Configuration for Truffle development console.
//
module.exports = {
networks: {
development: {
host: "localhost",
port: 9545,
network_id: "*",
gas: 4000000
}
@datawookie
datawookie / rockabye-baby.sh
Last active November 11, 2017 15:51
Download selected songs from Rockabye Baby! as MP3
#!/bin/bash
# Dowload lullabies from Rockabye Baby! for offline use.
#
# https://www.youtube.com/channel/UC7LesmfW8QPP7mDYYLwW4Aw
cat <<EOF | xargs youtube-dl --extract-audio --audio-format mp3 --
tl9eIKqplXg
-UUZRR8G8UI
aHq1MDvf4Wc
@datawookie
datawookie / moving_checksum.R
Last active December 29, 2015 06:51
Rolling Checksum
library(dplyr)
library(ggplot2)
library(scales)
checksum <- function(bytes) {
Reduce(bitwXor, bytes)
}
# Generate message with:
#