This file contains 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
git branch | grep -v '*' | egrep -o '[^ ]+' | xargs -n1 git show -s | less |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- IF PEN IS PRIVATE --> | |
<!-- <meta name="robots" content="noindex"> --> | |
<!-- END --> |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- IF PEN IS PRIVATE --> | |
<!-- <meta name="robots" content="noindex"> --> | |
<!-- END --> |
This file contains 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 engulf.formulas.markov-requests | |
"Support for generating markov chains of requests" | |
(:use clojure.pprint | |
[clojure.walk :only [keywordize-keys]]) | |
(:require [clojure.string :as string] | |
[clojure.tools.logging :as log] | |
[cheshire.core :as json]) | |
(:import java.util.TreeMap)) | |
(defn compile-transitions |
This file contains 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
# Count SLOC | |
export SLF=`mktemp -t cljsloc`; find src test -name "*.clj" | xargs egrep -v "(^[[:space:]]*$|^[[:space:]]*;)" | cut -d: -f1 > $SLF && echo "Files"; uniq -c $SLF; echo "Total" `cat $SLF | wc -l`; rm $SLF |
This file contains 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
x = _.reduce("a=b,c=d".split(/,/), function (m,kv) { s = kv.split(/=/); m[s[0]] = s[1]; return(m) }, {}) |
This file contains 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
Pose.Models.LabelTag = Backbone.Model.extend | |
Pose.Models.Color = Backbone.Model.extend | |
Pose.Models.Label = Backbone.Model.extend | |
defaults: | |
color: Pose.Models.Color | |
label_tags: Pose.Collections.LabelTags | |
Pose.Collections.Colors = Backbone.Collection.extend | |
model: Pose.Models.Color | |
Pose.Collections.LabelTags = Backbone.Collection.extend |
This file contains 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
java.util.concurrent.ThreadPoolExecutor.setCorePoolSize(int) | |
lamina.executors.core$thread_pool$reify__1673.execute(Runnable) | |
lamina.core.pipeline$start_pipeline$fn__1045$fn__1049.invoke(Object) | |
lamina.core.queue$r_obs$fn__883.invoke(Object) | |
lamina.core.observable$observer$reify__329.on_message(Object) | |
lamina.core.observable.ConstantObservable$fn__548.invoke() | |
lamina.core.observable.ConstantObservable.message(Object) | |
lamina.core.channel$enqueue.doInvoke(Object, Object) | |
clojure.lang.RestFn.invoke(Object, Object) | |
lamina.core.channel$poll$callback__966$fn__967$fn__968.invoke(Object) |
This file contains 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 increment-keys | |
"Given a map and a list of keys, this will return an identical map with those keys | |
with those keys incremented. | |
Keys with a null value will be set to 1." | |
[src-map & xs] | |
(into src-map (map #(vector %1 (inc (get src-map %1 0))) xs))) | |
; Example (increment-keys {:a 2} :a :b) => {:a 3 :b 1} |
This file contains 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
; Define the route, and specify that we want the 'garden-file' param | |
(defpage [:post "/upload"] {:keys [garden-file]} | |
; do some work | |
(let [{:keys [decoded-file uuid]} (decode-upload garden-file)] | |
(try | |
(garden/create uuid decoded-file) | |
(finally | |
(.delete decoded-file))) | |
; render some HTML based on that work | |
(common/layout [:p (format "File %s was created" uuid)])) |