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
/** | |
* 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
(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
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 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
#!/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 parallel-chan-map | |
(:require-macros [cljs.core.async.macros :refer (go alt!)]) | |
(:require [cljs.core.async :refer (>! close! put! chan )])) | |
(defn parallel-chan-map | |
"Read in-chan and put result of `(apply f in-chan-value args)` on out-chan, | |
potentially running items in parallel and yielding results out-of-order. | |
Function f must return something takeable (e.g. a go-block, channel, promise), | |
in essence spawning a \"subprocess\" which this function manages as a pool |
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 subclass | |
(:require [clojure.string :as string])) | |
;;TODO: definterface | |
; :closure/const | |
; :const | |
; :closure/constructor | |
; :closure/depreciated |
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 b64longs | |
"Encode and Decode java.lang.Long as a web-safe, identically-sortable Base64 string. | |
I.e., the Long and the string will both sort exactly the same way, and none of | |
the characters of the string ever need to be escaped in a web context (e.g. in html, | |
in xml, in any part of a url). | |
Requires net.iharder.Base64 class which is Public Domain. | |
See http://iharder.sourceforge.net/current/java/base64/ | |
Add this as a leinigen dependency. |
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.*; | |
import java.util.*; | |
// for imageio metadata | |
import javax.imageio.*; | |
import javax.imageio.stream.*; | |
import javax.imageio.metadata.*; | |
// for xml handling | |
import org.w3c.dom.*; |