This file contains hidden or 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
azs = [:a, :b, :c] | |
cidr_block_lookup = { | |
public: { a: '172.20.0.0/24', | |
b: '172.20.1.0/24', | |
c: '172.20.2.0/24' }, | |
private: { a: '172.20.8.0/24', | |
b: '172.20.9.0/24', | |
c: '172.20.10.0/24' } | |
} |
This file contains hidden or 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
(expect (partial apply =) | |
(from-each [[result sexp] { | |
3 3 | |
true true | |
2 '(+ 1 1) | |
;; POTENTIALLY LOADS MORE EGS | |
} | |
] | |
[result (eval sexp)])) |
This file contains hidden or 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
user> (def a [[1 2] [3 4] [5 6]]) | |
#'user/a | |
user> (def b [[1 7] [2 8] [5 6]]) | |
#'user/b | |
user> (map (fn [[a b] [c d]] | |
(if (= a c) | |
[b d])) | |
a |
This file contains hidden or 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
(defn percentiles [xs] | |
(let [sorted (sort xs) | |
how-many (count sorted) | |
percentile (fn [n] | |
(let [idx (Math/floor (* how-many (/ n 100)) )] | |
(nth sorted idx)))] | |
{:mean (mean xs) | |
:median (percentile 50) | |
:90 (percentile 90) | |
:95 (percentile 95) |
This file contains hidden or 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 ubuntu | |
RUN apt-get update | |
RUN apt-get install -qq -y wget python-software-properties software-properties-common zip curl ruby1.9.1 | |
RUN add-apt-repository ppa:webupd8team/java | |
RUN apt-get update | |
RUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections | |
RUN apt-get install -qq -y oracle-java7-installer |
This file contains hidden or 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
(fn [cards] | |
(let [card-type (fn [input] | |
(let [[suit rank] (rest | |
(clojure.string/split input #"")) | |
suits {"D" :diamond | |
"H" :heart | |
"C" :club} | |
ranks (zipmap (map | |
str '[2 3 4 5 6 7 8 9 T J Q K A]) | |
(range 13))] |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
var CLOSURE_NO_DEPS = true; | |
var COMPILED = false; | |
var goog = goog || {}; | |
goog.global = this; | |
goog.DEBUG = true; | |
goog.LOCALE = "en"; | |
goog.provide = function(name) { | |
if(!COMPILED) { | |
if(goog.isProvided_(name)) { | |
throw Error('Namespace "' + name + '" already declared.'); |
This file contains hidden or 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
#!/bin/sh | |
syntax_errors=0 | |
error_msg=$(mktemp /tmp/error_msg.XXXXXX) | |
if git rev-parse --quiet --verify HEAD > /dev/null | |
then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object |
This file contains hidden or 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
(ns groupings-clj.core | |
(:use [clojure.java.io :as io]) | |
(:require [clojure.string :as str]) | |
(:import (org.apache.lucene.analysis Analyzer PorterStemFilter PorterStemmer) | |
(org.apache.lucene.analysis.standard StandardAnalyzer) | |
(org.apache.lucene.util Version) | |
(org.apache.lucene.analysis.tokenattributes TermAttribute) | |
(org.apache.lucene.analysis.standard StandardTokenizer) | |
;; (org.apache.lucene.analysis.en PorterStemFilter PorterStemmer) |
This file contains hidden or 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
(ns groupings-clj.core | |
(:use [clojure.java.io :as io]) | |
(:require [clojure.string :as str]) | |
(:import (org.apache.lucene.analysis Analyzer PorterStemFilter PorterStemmer) | |
(org.apache.lucene.analysis.standard StandardAnalyzer) | |
(org.apache.lucene.util Version) | |
(org.apache.lucene.analysis.tokenattributes TermAttribute) | |
(org.apache.lucene.analysis.standard StandardTokenizer) | |
;; (org.apache.lucene.analysis.en PorterStemFilter PorterStemmer) |