Skip to content

Instantly share code, notes, and snippets.

View sgrove's full-sized avatar
💭
Infinigraph, and beyond!

Sean Grove sgrove

💭
Infinigraph, and beyond!
View GitHub Profile
[
{
"created_at": "Thu Apr 06 15:28:43 +0000 2017",
"id": 850007368138018817,
"id_str": "850007368138018817",
"text": "RT @TwitterDev: 1/ Today we’re sharing our vision for the future of the Twitter API platform!nhttps://t.co/XweGngmxlP",
"truncated": false,
"entities": {
"hashtags": [],
"symbols": [],
@sgrove
sgrove / console.re
Created December 8, 2016 17:20
Example Reason+Bucklescript bindings
external log : 'anything => unit = "console.log" [@@bs.val];
external trace : 'anything => unit = "console.trace" [@@bs.val];
@sgrove
sgrove / Test.re
Last active December 9, 2016 18:37
/**
* Welcome to Reason.
*/
open Lwt;
open Cohttp;
open Cohttp_lwt_unix;
let body =
@sgrove
sgrove / core.cljs
Created September 9, 2015 16:40
ReactMotion + ClojureScript
(ns motionable.core
(:require [om.core :as om]
[om.dom :as dom]
[React :as r :refer [createElement createClass render]]
[ReactMotion :as rm]))
(enable-console-print!)
(def app-state
(atom {:text "Hello world!"}))
From 6ae91a7285e7cf4976185891c1022847aaca56a8 Mon Sep 17 00:00:00 2001
From: Sean Grove <s@bushi.do>
Date: Wed, 28 Aug 2013 14:43:55 -0700
Subject: [PATCH] Add failing syntax test
---
test/cljs/cljs/core_test.cljs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/test/cljs/cljs/core_test.cljs b/test/cljs/cljs/core_test.cljs
@sgrove
sgrove / compiler.cljs
Created August 25, 2013 20:52
Example compiler output for constants-table
(defn emit-constants-table [table]
(doseq [[keyword value] table]
(emits value "=new cljs.core.Keyword(")
(emit-constant (.sym keyword))
(emits ");\n")))
@sgrove
sgrove / analyzer.clj
Created August 25, 2013 19:36
Real Keywords 00002
; Changes to analyzer.clj
(def keyword_counter (atom 0))
(defn genid
"Returns a new symbol with a unique name. If a prefix string is
supplied, the name is prefix# where # is some unique number. If
prefix is not supplied, the prefix is 'K__'."
([] (genid "K__"))
([prefix-string]
(when (nil? keyword_counter)
@sgrove
sgrove / analyzer.clj
Last active December 21, 2015 11:49
Real keywords 00001
(def ^:dynamic *real-keywords?* true)
(def ^:dynamic *constant-table* (atom {}))
(defn reset-constant-table! []
(reset! *constant-table* {}))
(defn register-constant! [k]
(println "Registering constant!")
(swap! *constant-table*
(fn [table]
var foo = {ns_shadow_test:{}};
foo.ns_shadow_test.bar = function() {
return 1
};
foo.ns_shadow_test.quux = function(a) {
return a.ns_shadow_test.bar.call(null) + a
};
foo.ns_shadow_test.test_shadow = function() {
if(cljs.core._EQ_.call(null, foo.ns_shadow_test.quux.call(null, 2), 3)) {
return null

Edit your cljsbuild compiler options and add a source map output location. Wherever you put it, it needs to be accessible by the browser

:cljsbuild {:test-commands {"unit-tests" ["runners/phantomjs.js"
                                        "resources/public/js/vendor/handlebars-1.0.rc.1.min.js"
                                        "resources/private/js/unit-test.js"]}
          :builds
          [{:source-paths ["src/cljs"],
            :id "dev",
            :compiler {:pretty-print true,

:output-dir "resources/public/js/bin-debug",