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 ezducerdemo) | |
;; | |
;; 1st take | |
;; | |
(defn ezducer [constructor] | |
(fn [reducer] | |
(let [steps (fn [a vs] | |
;; Use loop/recur instead of reduce to avoid reduce's |
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
(import '[java.lang.reflect Method Modifier]) | |
(set! *warn-on-reflection* true) | |
(defn- samsig | |
"Given a SAM interface, returns the j.l.reflect.Method of the abstract method" | |
[sym] | |
(let [kls (resolve sym)] | |
(if (and (class? kls) (.isInterface ^Class kls)) | |
(let [mid (fn [^Method m] [(.getName m) (vec (.getParameterTypes 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
#!/bin/bash | |
# author Ghadi Shayban <[email protected]> | |
set -e | |
if [ -z ${1+x} ] | |
then | |
echo provide an asm git sha / ref | |
exit 1 | |
fi |
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
defmodule Do do | |
def dont think, about, it, but, please do | |
[think, about, it, please] | |
end | |
end | |
Do.dont :worry, :about, :grouping, :any, :arguments | |
=> [:worry, :about, :grouping, :arguments] |
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 typehint.core) | |
;; A little type hint hint... | |
(set! *warn-on-reflection* true) | |
;; There are two ways to type hint the return value of a function, but one is | |
;; (technically) wrong: | |
(defn ^String as-string0 |
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 strum.core | |
(:refer-clojure :exclude [defn]) | |
(:require | |
[clojure.spec :as spec] | |
[clojure.spec.test :as spec.test])) | |
;; --------------------------------------------------------------------- | |
;; Prelude | |
;; HACK: Currently, as of Clojure 1.9.0-alpha14, there is a bug with |
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
dash_id=xxxx | |
api_key=xxx | |
app_key=xxx | |
# 1. export | |
curl -X GET "https://app.datadoghq.com/api/v1/dash/${dash_id}?api_key=${api_key}&application_key=${app_key}" > dash.json | |
# 2. edit dash.json | |
move "graphs", "title", "description" up one level in the json hierarchy, from being beneath "dash" to being at the same level |
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
(defelem blink | |
[{:keys [interval :as attr] :or {interval 1000}} kids] | |
(with-let [container (span (dissoc attr :interval) kids)] | |
(with-init! | |
(with-interval interval | |
(.toggle (js/jQuery container)))))) |
NewerOlder