I hereby claim:
- I am jphackworth on github.
- I am jph (https://keybase.io/jph) on keybase.
- I have a public key whose fingerprint is A2FC 705E E920 AC46 D190 668C DF1A 4827 7912 DF21
To claim this, I am signing this object:
user=> (pprint (admin-available-functions)) [13/1239] | |
{:AdminLog_subscribe | |
{:file {:required 0, :type "String"}, | |
:level {:required 0, :type "String"}, | |
:line {:required 0, :type "Int"}}, | |
:AdminLog_unsubscribe {:streamId {:required 1, :type "String"}}, | |
:Admin_asyncEnabled {}, | |
:Admin_availableFunctions {:page {:required 0, :type "Int"}}, | |
:Allocator_bytesAllocated {}, | |
:Allocator_snapshot {:includeAllocations {:required 0, :type "Int"}}, |
user=> (def b (map #(add-to-queue inc %) (range 5))) | |
#'user/b | |
user=> b | |
(<< … >> << … >> << … >> << … >> << … >>) | |
user=> b | |
(<< … >> << … >> << … >> << … >> << … >>) | |
user=> b | |
(<< … >> << … >> << … >> << … >> << … >>) | |
user=> b | |
(<< … >> << … >> << … >> << … >> << … >>) |
user=> (start-job-consumer) | |
nil | |
user=> (reset! worker-interval 2000) | |
2000 | |
user=> (def a (add-to-queue inc 1)) | |
#'user/a | |
user=> a | |
<< … >> | |
user=> a | |
<< … >> |
;;; Lamina queueing | |
(def job-queue (lamina/channel)) | |
(def worker-interval (atom 250)) | |
(defn consume-jobs [] | |
(let [{:keys [c f args] :as msg} | |
@(lamina/read-channel job-queue)] | |
(Thread/sleep @worker-interval) | |
(lamina/enqueue c (apply f args)))) |
I hereby claim:
To claim this, I am signing this object:
(defn normalize-ticker [exchange ticker] | |
(case exchange | |
:btce {:last (:last ticker) | |
:buy (:buy ticker) | |
:sell (:sell ticker) | |
:high (:high ticker) | |
:avg (:avg ticker) | |
:avg_btc_usd (:avg @btc-usd-price) | |
:low (:low ticker) | |
:vol (:vol ticker) ; _usd or _btc |
(ns lobos.migrations | |
(:refer-clojure | |
:exclude [alter drop bigint boolean char double float time]) | |
(:use (lobos [migration :only [defmigration]] core schema config helpers))) | |
(defmigration add-accounts-table | |
(up [] (create | |
(tbl :accounts | |
(varchar :username 30 :unique) | |
(boolean :admin (default 0)) |
(ns lobos.migrations | |
(:refer-clojure | |
:exclude [alter drop bigint boolean char double float time]) | |
(:use (lobos [migration :only [defmigration]] core schema config helpers))) | |
(defmigration add-accounts-table | |
(up [] (create | |
(tbl :accounts | |
(varchar :username 30 :unique) | |
(boolean :admin (default 0)) |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"github.com/kylelemons/godebug/pretty" | |
"io/ioutil" | |
"net/http" | |
"strconv" | |
) |
; Comments start with semicolons. | |
; Clojure is written in "forms", which are just | |
; lists of things inside parentheses, separated by whitespace. | |
; | |
; The clojure reader assumes that the first thing is a | |
; function or macro to call, and the rest are arguments. | |
; | |
; Here's a function that sets the current namespace: | |
(ns test) |