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
| :- use_module(library(pairs)). | |
| :- use_module(library(reif)). | |
| not_in_list(K, L) :- | |
| if_((L = []), | |
| true, | |
| ([X | More] = L, | |
| dif(K, X), | |
| not_in_list(K, More))). |
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
| use_module(library(lists)). | |
| /* Bind updates a state given a list of binding names and a list of | |
| corresponding values. The special binding form &(args) binds `args` to all | |
| remaining arguments. Used to update contexts for e.g. function evaluation. */ | |
| bind(S, S, [], []). | |
| /* Varargs */ | |
| bind(S1, S2, [&(Var)], Vals) :- | |
| S2 = S1.put(Var, Vals). | |
| bind(S1, S3, [Var | Vars], [Val | Vals]) :- |
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
| :- use_module(library(reif)). | |
| axiom([quote, X], X). | |
| axiom([atom, X], R) :- | |
| axiom(X, XR), | |
| ((atomic(XR), R = t, !) ; | |
| (compound(XR), R = [])). | |
| axiom([eq, X, Y], 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
| (ns bifurcan-lazy-union | |
| (:require [bifurcan-clj [core :as b] | |
| [list :as bl] | |
| [map :as bm] | |
| [set :as bs]] | |
| [dom-top.core :refer [loopr]] | |
| [potemkin :refer [definterface+]]) | |
| (:import (io.lacuna.bifurcan ISet | |
| Lists | |
| Sets |
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
| Hi Kyle, | |
| My name is Tammy and I am on the team at Riviera Partners. Your name surfaced | |
| in several of my searches today and across various filters - from distributed | |
| systems to Clojure and encompassing Ruby and JavaScript. Well-rounded | |
| individual, are we? I also heard from a former colleague of mine that your | |
| programming began at the tender age of 2.... impressive! I just signed up for | |
| CodeAcademy - should be interesting! | |
| I am not sure how things are going for you at Boundary (are you still there)? |
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
| ## Clean new node | |
| [x] Shut down Mastodon | |
| [x] Shut down ES | |
| [x] Shut down Redis | |
| [x] Delete ES data | |
| [x] Delete Redis data | |
| [x] Delete Postgres data | |
| ## Prep new node |
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 fucking 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
| #!/bin/bash | |
| DIR=`mktemp -dt pdf-sign.XXXXXXXX` || exit 1 | |
| cd "$DIR" | |
| pdfseparate "$1" "$DIR/page%d.pdf" | |
| inkscape `ls | tail -1` | |
| pdfunite page*.pdf "$1 signed.pdf" | |
| rm -rf "$DIR" |
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
| user=> (-> '(dt/loopr [sum 0] [x xs, y ys] (recur (+ sum x y))) macroexpand pprint) | |
| (let* [sum 0 | |
| sum (clojure.core/reduce | |
| (clojure.core/fn reduce-x-2690 [sum x] | |
| (clojure.core/reduce (clojure.core/fn reduce-y-2692 [sum y] | |
| (. clojure.lang.Numbers (add (. clojure.lang.Numbers (add sum x)) y))) | |
| sum | |
| ys)) | |
| sum | |
| xs)] |
NewerOlder