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
hKRib2R5hqhkZXRhY2hlZMOpaGFzaF90eXBlCqNrZXnEIwEghP/1XFdg44BdXcYiy1kQk12h2oV3r2gOyZoLQ5pV3XsKp3BheWxvYWTFAuh7ImJvZHkiOnsia2V5Ijp7ImVsZGVzdF9raWQiOiIwMTIwODRmZmY1NWM1NzYwZTM4MDVkNWRjNjIyY2I1OTEwOTM1ZGExZGE4NTc3YWY2ODBlYzk5YTBiNDM5YTU1ZGQ3YjBhIiwiaG9zdCI6ImtleWJhc2UuaW8iLCJraWQiOiIwMTIwODRmZmY1NWM1NzYwZTM4MDVkNWRjNjIyY2I1OTEwOTM1ZGExZGE4NTc3YWY2ODBlYzk5YTBiNDM5YTU1ZGQ3YjBhIiwidWlkIjoiNjZkMTM2YmZmYzQzNzAyZmUzNDYxYzM4OTlhYjNmMTkiLCJ1c2VybmFtZSI6ImpkdWJpZSJ9LCJzZXJ2aWNlIjp7Im5hbWUiOiJnaXRodWIiLCJ1c2VybmFtZSI6ImpkdWJpZSJ9LCJ0eXBlIjoid2ViX3NlcnZpY2VfYmluZGluZyIsInZlcnNpb24iOjF9LCJjbGllbnQiOnsibmFtZSI6ImtleWJhc2UuaW8gZ28gY2xpZW50IiwidmVyc2lvbiI6IjEuMC4xNiJ9LCJjdGltZSI6MTQ2OTE0MTYzNSwiZXhwaXJlX2luIjo1MDQ1NzYwMDAsIm1lcmtsZV9yb290Ijp7ImN0aW1lIjoxNDY5MTQxNTgxLCJoYXNoIjoiYzJkZjQ0M2QxYjA2MzY3NzE4MTg3NGRiMmUyOGI0MTRlNjhkMDNlMjllNjFhZjMyMjNkYzBiNGE0M2JjOTM2ZGJmOTY3MGYyMWQyYTMyMWIxYzQ5NjVlYjVlMzY4ZjRiZDZhMTBhNjZhNmNmNzc2Y2E0ZWY1YWM2N2E3YzA2ODkiLCJzZXFubyI6NTM2ODc4fSwicHJldiI6IjYxODcxNTVlNjhlZWU5ODE3MTJmMmM1OTAxYjlhODIzZDk2Y2Jl |
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
;; assume 1 channel, and user id is always the shared key (kafka) | |
;; use cases | |
;; - logging (existing ladder.logging) | |
;; - publishing results of mutations with request infomation | |
(require '[ladder.logging :as log]) | |
;; logging | |
(log/info :foo/bar {:baz :quz}) |
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 datomic.example | |
(:require [datomic.api :as d])) | |
;; question about the function `d/db` | |
;; | |
;; in `example` pull `d/pull` always see the transaction that commits [:db/add id :foo :bar]? | |
(defn example | |
[conn id] | |
(do @(d/transact conn [{:db/id id :foo :bar}]) |
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
;; nice for reagent | |
(defmacro defc | |
"syntactic sugar for declaring stateful components. Keeps signature of inner | |
and outer params consistent. | |
Before: | |
(defn stateful-component | |
[params] | |
(let [local state] |
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 example.core | |
(:require-macros [example.macro :refer [defc]]) | |
(:require [reagent.core :as reagent :refer [atom]])) | |
;; without macro | |
(defn component | |
"example stateful component" | |
[a b c d] | |
(let [state (atom nil)] |
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
{ | |
"globals": { | |
"test": [ | |
"before", | |
"beforeEach", | |
"after", | |
"afterEach", | |
"it", | |
"describe" | |
] |
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
/* In api.js */ | |
/** | |
* @param callback {function(err)} | |
* | |
* err.type in { 'malformed', 'forbidden', 'service_unavailable' } | |
*/ | |
exports.connect = function (callback) { | |
var err = new Error('Service Unavailable, try again'); |
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
//write your karel javascript | |
//code here. | |
function run() { | |
while(frontIsClear()) { | |
fillHole(); | |
} | |
} |
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
-Sign up newbs to GMAIL | |
Send email | |
Search email (below) | |
Forward email | |
Chat |