Skip to content

Instantly share code, notes, and snippets.

package errorist;
import org.h2.jdbcx.JdbcConnectionPool;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.time.LocalDate;
import java.time.ZoneId;
methylene /
Last active May 22, 2016
rsync backup script
#!/bin/bash -e
function warn { echo -e " \e[93m[$1]\e[0m"; }
function printDone { echo -e " \e[92m[DONE]\e[0m"; }
# Backup a path
function performBackup {
# Use absolute path
View prime_field.v
Require Import ZArith.
Require Import Znumtheory.
Definition prime_z := {f | prime f}.
Record prime_field (f: prime_z) : Set := pf_make {n: Z}.
Definition pf_add {p: prime_z} (x y : (prime_field p)) :=
pf_make p ((n _ x) + (n _ y)).
import io.atlassian.fugue.Option;
import org.junit.Test;
import java.util.Objects;
import java.util.Optional;
public class CoreTest {
View friedman_ackermann.lisp
(in-package :cl-user)
(ql:quickload :optima)
(defpackage :ack-mann
(:use :common-lisp :optima)
(:export :ackermann))
(in-package :ack-mann)
View friedman_ackermann.clj
;; A version of the ackermann function, described in
(require '[clojure.core.match :refer [match]])
(defn ackermann [[k & r :as s] n]
(if (not (seq s))
(match [k n]
[1 _] (recur r (*' 2 n))
[_ 1] (recur (cons (dec k) r) 1)
methylene / invert_map.clj
Created Jan 15, 2014
clojure invert multi-valued map
View invert_map.clj
(defn invert-map [m]
(fn [acc k v]
(merge-with (comp vec concat)
(apply array-map (interleave v (repeat [k])))))
{} m))
methylene / murmur.clj
Last active Nov 29, 2016
murmur hash in clojure
View murmur.clj
(def murmur
(let [m (]
(fn ^Long [^String s]
(-> (doto (.newHasher m)
(.putString s
View peirce_implies_lem.v
Definition peirce := forall (p q : Prop),
((p -> q) -> p) -> p.
methylene / dabblet.css
Created Jan 4, 2013
The first commented line is your dabblet’s title
View dabblet.css
* The first commented line is your dabblet’s title
background: #ggh;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
You can’t perform that action at this time.