Skip to content

Instantly share code, notes, and snippets.

~ $ ls *.log | awk 'BEGIN { print "[" } { printf "{:dirname \"%s\"} ", $0 } END { print " ] " }'
[
{:dirname "<none>.log"} {:dirname "_region_.log"} {:dirname "circle.log"} {:dirname "npm-debug.log"} ]
~ $
@jobez
jobez / private.clj
Created January 1, 2016 06:38 — forked from egamble/private.clj
Two ways to call private methods in Clojure.
;; This fn allows calling any method, as long as it's the first with that name in getDeclaredMethods().
;; Works even when the arguments are primitive types.
(defn call-method
[obj method-name & args]
(let [m (first (filter (fn [x] (.. x getName (equals method-name)))
(.. obj getClass getDeclaredMethods)))]
(. m (setAccessible true))
(. m (invoke obj (into-array Object args)))))
cljs.user> (doc +)
-------------------------
cljs.core/+
([] [x] [x y] [x y & more])
Returns the sum of nums. (+) returns 0.
nil
cljs.user> (ns batman)
WARNING: batman is a single segment namespace at line 1 <cljs repl>
batman> (cljs.repl/doc +)
-------------------------
(ns ^:figwheel-load query-test.ios.core
(:require-macros [env.require-img :refer [require-img]]
[natal-shell.components :refer [view text switch-ios
image scroll-view touchable-highlight
text-input navigator]])
(:require [datascript.core :as d]
[cljs.pprint :as pprint]
[om.next :as om :refer-macros [defui ui]]
[cljs-time.core :as cljs-time]))
@jobez
jobez / scratch2.org
Last active December 8, 2015 09:28
scratch2.org

render function

(let [renderf (fn [data]
                      (binding [*reconciler* this
                                *shared*     (merge
                                               (:shared config)
                                               (when (:shared-fn config)
                                                 ((:shared-fn config) data)))]
                        (let [c (cond
                                  (not (nil? target)) ((:root-render config) (rctor data) target)

we make a jsc env with a reload special function

(in-ns 'reload-env)

(defrecord reloadJscEnv [response-promise bonjour-name webdav-mount-point socket options]
  repl/IReplEnvOptions
  (-repl-options [this]
    {:require-foreign true
     :special-fns {'reload! (fn self
                             ([repl-env env form]
(defproject saphograph "0.1.0"
:description "mentat network"
:url ""
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/clojurescript "0.0-2197"]]
:node-dependencies []
:plugins [[lein-npm "0.4.0"]
[lein-cljsbuild "1.0.3"]]
:hooks [leiningen.cljsbuild]
:cljsbuild {
@jobez
jobez / text-1.1.1.1.log
Created May 1, 2014 22:36
cabal install text-1.1.1.1 receives fatal error: too many errors emitted, stopping now [-ferror-limit=] 29 warnings and 20 errors generated.
Configuring text-1.1.1.1...
/var/folders/44/z7wkzmk56h9gpnm5lmh7zvjw0000gn/T/6291.c:1:12:
warning: control reaches end of non-void function [-Wreturn-type]
int foo() {}
^
1 warning generated.
Building text-1.1.1.1...
Preprocessing library text-1.1.1.1...
@jobez
jobez / core.cljs
Last active August 29, 2015 13:56
(ns select.core
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true])
(:import [goog.ui IdGenerator] ;; unique id goodness
))
(defn guid []
(.getNextUniqueId (.getInstance IdGenerator)))
(enable-console-print!)
@jobez
jobez / test
Created July 29, 2013 16:25
this is a test!
# the only markdown syntax i know from memory