Skip to content

Instantly share code, notes, and snippets.

View pangloss's full-sized avatar
😃

Darrick Wiebe pangloss

😃
View GitHub Profile
@pangloss
pangloss / aliases.clj
Last active July 10, 2022 18:00
A babashka script to sort through deps.edn aliases
#!/usr/bin/env bb
(ns aliases
(:require [clojure.edn :as edn]
[clojure.tools.cli :refer [parse-opts]]
[clojure.string :as str]))
(defn show-aliases [{:keys [in-string]}]
(let [filter-list (if in-string
(partial filter (fn [[kw body]]
(str/includes? (str kw) in-string)))
name: "segnet"
layer {
name: "data"
type: "DenseImageData"
top: "data"
top: "label"
dense_image_data_param {
source: "/SegNet/CamVid/train.txt" # Change this to the absolute path to your data file
batch_size: 4 # Change this number to a batch size that will fit on your GPU
shuffle: true
@pangloss
pangloss / XNBootstrap
Last active August 29, 2015 14:13
XN Logic Developer host machine bootstrap for Windows
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
choco install ruby vagrant virtualbox
gem update --clear-sources --source http://rubygems.org/ --system
gem install xnlogic
### Keybase proof
I hereby claim:
* I am pangloss on github.
* I am pangloss (https://keybase.io/pangloss) on keybase.
* I have a public key whose fingerprint is CF64 AF42 70F8 2951 1E26 DB6E 4E6A D7F7 35D6 AF65
To claim this, I am signing this object:
@pangloss
pangloss / .ctags
Created October 28, 2014 18:27
ClojureScript ctags configuration
--exclude=.git
--exclude=.svn
--exclude=resources/*
--exclude=*/resources/*
--exclude=*/public/*
--exclude=.repl/*
--exclude=*/.repl/*
--exclude=out/*
--exclude=*/out/*
--exclude=target/*
@pangloss
pangloss / js-to-clj-bench.cljs
Created August 25, 2014 00:23
js->clj benchmarks
(ns js-to-clj-bench.core)
; Run this benchmark at: http://jsperf.com/js-clj-transducer-test
(let [data
"[{ \"web-app\": { \"servlet\": [ { \"servlet-name\": \"cofaxCDS\", \"servlet-class\": \"org.cofax.cds.CDSServlet\", \"init-param\": { \"configGlossary:installationAt\": \"Philadelphia, PA\", \"configGlossary:adminEmail\": \"ksm@pobox.com\", \"configGlossary:poweredBy\": \"Cofax\", \"configGlossary:poweredByIcon\": \"/images/cofax.gif\", \"configGlossary:staticPath\": \"/content/static\", \"templateProcessorClass\": \"org.cofax.WysiwygTemplate\", \"templateLoaderClass\": \"org.cofax.FilesTemplateLoader\", \"templatePath\": \"templates\" } }, { \"servlet-name\": \"cofaxAdmin\", \"servlet-class\": \"org.cofax.cds.AdminServlet\" }, { \"servlet-name\": \"cofaxTools\", \"servlet-class\": \"org.cofax.cms.CofaxToolsServlet\", \"init-param\": { \"templatePath\": \"toolstemplates/\", \"log\": 1, \"logLocation\": \"/usr/local/tomcat/logs/CofaxTools.log\", \"logMaxSize\": \"\", \"dataLog\": 1, \"dataLogLocation
:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/clojurescript "0.0-2311"]
[org.clojure/core.async "0.1.338.0-5c5012-alpha"]
[figwheel "0.1.3-SNAPSHOT" :exclusions [org.clojure/core.async]]]
:plugins [[lein-figwheel "0.1.3-SNAPSHOT" :exclusions [org.clojure/core.async]]
[org.clojure/core.async "0.1.338.0-5c5012-alpha"]
[lein-cljsbuild "1.0.3"]
[com.cemerick/clojurescript.test "0.3.1"] ]
@pangloss
pangloss / async.cljs
Last active December 27, 2015 15:19
delay-chan
(ns async
(:require cljs.core.match
[cljs.core.async.impl.protocols :as impl]
[cljs.core.async.impl.channels :as channels]))
(defn delay-chan*
"chan-thunk is something that when deref'd returns a channel. The
first thing that that channel emits will be saved and always returned
by the channel this produces."
[chan-thunk]
The expected result:
>> show(search.simple_router.route("/model/tweet/rel/responses"))
{:type :model, :model [tweet], :child {:type :rel, :rel responses}}
The actual result:
>> show(search.logic_router.routes(1, "/model/tweet/rel/responses"))
({:type :model, :model <lvar:value_238>, :child <lvar:child_241>})
@pangloss
pangloss / partition-chan.cljs
Created September 14, 2013 14:19
Prevent partition-chan from becoming a spin lock when the input channel is closed.
(defn partition-chan
([start-pred in] (partition-chan start-pred (complement start-pred) in))
([start-pred end-pred in]
(let [out (chan)]
(go
(loop []
(if-let [val (<! in)]
(if (start-pred val)
(let [next-chan (chan)]
(>! out next-chan)