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 | |
# git-archive-branch.sh | |
# | |
BRANCHNAME= | |
PUSH= | |
usage() { | |
cat 1>&2 << EOF | |
usage: $(filename $0) [-p] [-h] BRANCHNAME |
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 defenum | |
(:require [clojure.string :as str] | |
cljs.compiler)) | |
(defn unzip | |
([s] (unzip 2 s)) | |
([n s] (apply map vector (partition n s)))) | |
(defmacro jso | |
"Like js-obj, except the keys are emitted as unquoted munged symbols. Keys |
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 re | |
import array | |
import collections | |
import bisect | |
re_dup_g = re.compile(r'(.).*\1', re.DOTALL) | |
re_dup_ng = re.compile(r'(.).*?\1', re.DOTALL) | |
def isunique_reg(s, search=re_dup_g.search): |
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 breeze.util.uuid | |
"Utilities for generating version 5 (SHA-1 hashing) uuids. | |
This implementation should conform to RFC 4122, section 4.3. | |
Includes shortcuts for generating uuids for breeze rule hashes." | |
(import java.security.MessageDigest | |
java.util.UUID | |
java.nio.ByteBuffer | |
java.nio.charset.StandardCharsets)) | |
(def rule-namespace-uuid |
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
/** | |
* Javascript port of Clojure's flavor of Murmur3. | |
* See https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Murmur3.java | |
* | |
* Find at: https://gist.github.com/favila/9088146 | |
* By favila (Francis Avila) 2014-02-19 | |
*/ | |
goog.provide('cljs.lang.murmur3'); | |
goog.require('cljs.core'); |
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 | |
# Produce a squash-commit patch from a branch of changes | |
MASTER=$1 | |
PATCHBRANCH=$2 | |
SQUASHBRANCH="$PATCHBRANCH-squash" | |
MESSAGE=$3 | |
git checkout -b $SQUASHBRANCH $MASTER && | |
git merge --squash $PATCHBRANCH && | |
git commit -a -m "$MESSAGE" && |
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 murmur3 | |
"Implementation of clojure.lang.Murmur3 in clojurescript (assuming javascript numerics). | |
by Francis Avila 2014-02-24") | |
(def imul | |
"32-bit signed integer multiply with overflow; alias of js/Math.imul. | |
Does not follow unchecked-multiply-int semantics! Only two args accepted; if | |
args are missing returns 0." | |
(if (exists? (aget js/Math "imul")) | |
(aget js/Math "imul") |
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 zip-partition | |
"Return a sequence of length n of sequences of every nth item, each offset | |
by one. Suitable for building the rows of a table with n columns where the | |
sequence items flow down columns then rows. Example: | |
(zip-partition [0 1 2 3 4] 2) -> ((0 4) | |
(1 nil) | |
(2 nil) | |
(3 nil))" | |
[s n] |
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 nametext [hn] | |
(->> [:fhir-attr/HumanName.prefix :fhir-attr/HumanName.given | |
:fhir-attr/HumanName.family :fhir-attr/HumanName.suffix] | |
(mapcat #(get hn %)) | |
(filter not-empty) | |
(interpose \space) | |
(apply str))) | |
(defn humanname-text-tx [d] | |
(->> (d/datoms d :avet :phi.element/type "fhir-type/HumanName") |
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
(def ^:const SIGN-BIT (bit-shift-left 1 63)) | |
(defn tempid-cljs->clj [tid] | |
(if (neg? tid) | |
(let [cljtid (-> tid (-) (bit-or SIGN-BIT))] | |
(d/tempid (d/part cljtid) (d/tx->t cljtid))) | |
tid)) | |
(defn tempid-clj->cljs [tid] | |
(if (neg? tid) |