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
{- Seth Brown | |
2014-12-13 | |
GHC 7.8.3 | |
sethbrown AT drbunsen DOT ORG | |
Copyright 2014 Seth Brown. All rights reserved. | |
data from: http://www.beeradvocate.com/lists/top/ | |
$ runghc ba-top-breweries.hs < data.txt | |
====================================== | |
Hill Farmstead Brewery,24 |
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
[Unit] | |
Description=IP Lookup | |
After=docker.service | |
[Service] | |
TimeoutStartSec=0 | |
Restart=always | |
ExecStartPre=-/usr/bin/docker kill lookup | |
ExecStartPre=-/usr/bin/docker rm lookup | |
ExecStartPre=-/usr/bin/docker pull icecreammatt/lookup |
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
#cloud-config | |
coreos: | |
update: | |
reboot-strategy: off | |
etcd: | |
discovery: https://discovery.etcd.io/<token> | |
addr: $private_ipv4:4001 | |
peer-addr: $private_ipv4:7001 | |
fleet: |
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 sort(&blk) | |
#TODO Make this not explode | |
raise Exception.new("Haw, Haw!") | |
end |
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
# patch nanoc's logging colors for solarized shinyness | |
# | |
# this is to work with the iTerm 2 color presets, | |
# which uses most of the "bright" color codes for the grayscale swatches | |
module Nanoc3::CLI | |
class Logger | |
(ACTION_COLORS ||= {}).update( | |
:create => "\e[38;5;2m", | |
:update => "\e[38;5;3m", | |
:identical => "\e[1;38;5;6m", |
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
class ToTextFilter < ::Nanoc3::Filter | |
identifier :to_text | |
type :binary => :text | |
def run(filename, params={}) | |
File.read(filename) | |
end | |
end | |
class ToBinaryFilter < ::Nanoc3::Filter | |
identifier :to_binary |
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
import qualified System | |
import qualified Data.List as List | |
import qualified Data.Char as Char | |
import qualified Data.HashMap.Strict as HashMap | |
main :: IO () | |
main = do | |
[arg] <- System.getArgs | |
text <- getContents | |
let n = read arg |
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
require 'formula' | |
class Vim < Formula | |
homepage 'http://www.vim.org/' | |
# Get stable versions from hg repo instead of downloading an increasing | |
# number of separate patches. | |
url 'https://vim.googlecode.com/hg/', :revision => '70eff6af1158' | |
version '7.3.462' | |
head 'https://vim.googlecode.com/hg/' |
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
# Regression models | |
lm(y ~ x, data=df) | |
glm(y ~ x, data=df, family=binomial(link="logit")) | |
glm(y ~ x, data=df, family=binomial(link="probit")) | |
glm(y ~ x, data=df, family=poisson(link="log")) | |
library(MASS) | |
glm.nb(y ~ x, data=df) |
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
# The following two commands remove any previously installed H2O packages for R. | |
if ("package:h2o" %in% search()) { detach("package:h2o", unload=TRUE) } | |
if ("h2o" %in% rownames(installed.packages())) { remove.packages("h2o") } | |
# Next, we download packages that H2O depends on. | |
if (! ("methods" %in% rownames(installed.packages()))) { install.packages("methods") } | |
if (! ("statmod" %in% rownames(installed.packages()))) { install.packages("statmod") } | |
if (! ("stats" %in% rownames(installed.packages()))) { install.packages("stats") } | |
if (! ("graphics" %in% rownames(installed.packages()))) { install.packages("graphics") } | |
if (! ("RCurl" %in% rownames(installed.packages()))) { install.packages("RCurl") } |
OlderNewer