Skip to content

Instantly share code, notes, and snippets.

var dubsearch = new function() {
var facets = ["artists", "genres", "show_year"];
var content = ["title", "featured_image", "post_date", "post_name"];
var resultsSelector = ".search-results";
var pageSize = 16;
var facetToModel = {
"artists": "artists",
"show_year": "showYears",
"genres": "genres"
### Keybase proof
I hereby claim:
* I am spieden on github.
* I am dah (https://keybase.io/dah) on keybase.
* I have a public key whose fingerprint is 61B5 E4A4 FA94 DB53 2148 3DF9 913F 314F 39B9 A0AD
To claim this, I am signing this object:
; I was able to export a static method I added to NSString with my protocol and category:
cljs.user=> (.hello js/NSString)
"world"
; .. but trying to do the same with a built-in method didn't work:
cljs.user=> (.stringWithContentsOfFilePathEncodingError js/NSString "/tmp/hello" NSUTF8StringEncoding nil)
undefined is not a function (evaluating 'NSString.stringWithContentsOfFilePathEncodingError("/tmp/hello",cljs.user.NSUTF8StringEncoding,null)')
@spieden
spieden / hrm.clj
Last active November 30, 2015 21:20
; asserting cardinality many ref values using lookup refs appears not to work:
{:db/index true,
:db/unique :db.unique/identity,
:db/valueType :db.type/string,
:db/noHistory false,
:db/isComponent false,
:db.install/_attribute :db.part/db,
:db/fulltext false,
:db/cardinality :db.cardinality/one,
(ns cpdx.db.entity-patch
(:require [clojure.data :as data]
[slingshot.slingshot :refer [throw+]]))
(defn pair->assertion [verb id-ref [attr value]]
[verb id-ref attr value])
(defn make-assertions [verb id-ref pairs]
(map (partial pair->assertion verb id-ref)
pairs))
{:user
{:dependencies [[alembic "0.3.2"] [org.clojure/tools.namespace "0.2.4"] [spyscope "0.1.5"]]
:plugins [[com.palletops/lein-shorthand "0.4.0"] [mvxcvi/whidbey "1.3.0"]]
:injections [(require 'spyscope.core)]
:shorthand {. [alembic.still/load-project alembic.still/distill alembic.still/lein
clojure.tools.namespace.repl/refresh clojure.test/run-tests clojure.test/run-all-tests
clojure.repl/doc clojure.repl/source clojure.repl/pst clojure.repl/dir]}}}
import clojure.lang.Delay;
import java.io.IOException;
import java.io.InputStream;
/**
* A lazily initialized InputStream using a Clojure delay.
*
* Construct with a delay that returns an InputStream. This delay will not be derefed until the
* DelayedInputStream is first accessed.
(ns shell
(:require [me.raynes.conch.low-level :as sh]
[slingshot.slingshot :refer [throw+ try+]]
[clojure.core.async :refer [go alts!!]]
[clojure.string :as str])
(:import (java.io IOException StringWriter)
(java.util.concurrent ExecutionException)))
(defn start-step! [upstream step]
(let [prev-step (-> upstream last)
FROM openjdk:8u121-jdk-alpine
RUN apk update && apk add curl bash
ADD https://private/url/for/datomic-pro.zip /datomic-pro.zip
RUN mkdir /datomic && unzip /datomic-pro.zip -d /datomic
ADD go.sh /go.sh
RUN chmod 755 /go.sh
(ns hiccup-paths
(:require [com.rpl.specter :as spr]))
(def tags-recursive
(spr/recursive-path [tags] p
(spr/cond-path
#(and (vector? %)
(tags (first %)))
spr/STAY