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
(require '[clojure.walk :as w]) | |
(defmacro both [a b pred] `(and (~pred ~a) (~pred ~b))) | |
(defn union-structure [a b] | |
(cond (= a b) a | |
(both a b vector?) [(reduce union-structure (concat a b))] | |
(both a b map?) (merge-with union-structure a b) | |
; Dunno, said the ghoul |
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 distinct-identical | |
"Like distinct, but only skips elements which are identical to those already | |
seen." | |
([xs] (distinct-identical xs {})) | |
([xs seen] | |
(when (seq xs) | |
(lazy-seq | |
(let [x (first xs) | |
h (hash x) | |
seen-xs (get seen h)] |
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 lights.core | |
(:require [me.raynes.clhue [config :as conf] | |
[lights :as lights]] | |
[clj-http.client :as http] | |
[clojure.pprint :refer [pprint]] | |
[clojure.java.io :as io] | |
[hickory [core :as h] | |
[select :as hs]] | |
[cheshire.core :as json] | |
[clojure.core.reducers :as r])) |
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
#!/usr/bin/fish | |
set FORMAT markdown+yaml_metadata_block+raw_tex+fenced_code_blocks+backtick_code_blocks+autolink_bare_uris+intraword_underscores+footnotes+auto_identifiers+ascii_identifiers | |
set OPTIONS -s --smart --number-sections | |
for dir in $argv | |
cd $dir | |
cp ../template.latex ./ | |
pandoc -f $FORMAT article.md $OPTIONS -o article.tex --template ../template.latex; and xelatex article.tex; # and evince article.pdf & |
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
INFO jepsen.util - 635 :ok :read [{:val -1, :sts 0N, :node -1, :process -1, :tb -1} {:val 0, :sts 14719766284873261820000000000N, :node 2, :process 12, :tb 0} {:val 1, :sts 14719766285512842950000000000N, :node 4, :process 19, :tb 0} {:val 2, :sts 14719766286362323440000000000N, :node 2, :process 7, :tb 0} {:val 3, :sts 14719766286703404550000000000N, :node 4, :process 9, :tb 0} {:val 4, :sts 14719766286915349320000000000N, :node 2, :process 27, :tb 0} {:val 5, :sts 14719766287378762320000000000N, :node 0, :process 10, :tb 0} {:val 6, :sts 14719766287988746000000000000N, :node 2, :process 12, :tb 0} {:val 7, :sts 14719766288492589830000000000N, :node 3, :process 8, :tb 0} {:val 8, :sts 14719766290198946260000000000N, :node 1, :process 21, :tb 0} {:val 9, :sts 14719766291533233220000000000N, :node 3, :process 18, :tb 0} {:val 10, :sts 14719766291994797100000000000N, :node 3, :process 28, :tb 0} {:val 11, :sts 14719766293022430150000000000N, :node 2, :process 7, :tb 0} {:val 12, :sts 14719766293773838770000000 |
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
27 :invoke :read 0 | |
7 :invoke :write 0 | |
23 :invoke :read 0 | |
23 :fail :read 0 | |
27 :fail :read 0 | |
3 :invoke :write 1 | |
10 :invoke :read 0 | |
16 :invoke :read 0 | |
4 :invoke :write 2 | |
22 :invoke :read 0 |
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
(defrecord Retry [bindings]) | |
(defmacro with-retry | |
"It's really inconvenient not being able to recur from within (catch) | |
expressions. This macro wraps its body in a (loop [bindings] (try ...)). | |
Provides a (retry & new bindings) form which is usable within (catch) blocks: | |
when this form is returned by the body, the body will be retried with the new | |
bindings." | |
[initial-bindings & body] | |
(assert (vector? initial-bindings)) |
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
Hey — | |
I'm writing to let you know that I’ve left my full-time role at Product Hunt. | |
After a few amazing years of helping founders build products and find early | |
adopters, I’ve made the decision to move on (more on that here). This journey | |
has been, by far, the most fulfilling work of my life. I can't imagine a better | |
team of folks to have worked towards this goal alongside. | |
It's been a pleasure to partner—and become friends—with so many of you. I'll |
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
import java.io.File; | |
import java.io.IOException; | |
import java.util.Random; | |
import java.util.Scanner; | |
/** | |
* Boggle. | |
* | |
* @author Kyle Kingsbury | |
* |
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
import java.util.*; | |
/** | |
* Array-based stack implementation. | |
* | |
* Kyle Kingsbury CS127 (Carleton College, Winter 2006) | |
*/ | |
public class MyStack<E> implements RealStack<E> { | |
// Data |