Skip to content

Instantly share code, notes, and snippets.

--- src/clj/cljs/analyzer.clj 2012-11-17 01:01:55.712323358 -0500
+++ src/cljs/cljs/analyzer.cljs 2012-11-17 11:51:47.030558150 -0500
@@ -6,14 +6,23 @@
; the terms of this license.
; You must not remove this notice, or any other, from this software.
-(set! *warn-on-reflection* true)
+;; (set! *warn-on-reflection* true)
(ns cljs.analyzer
--- /dev/null 2012-11-27 16:05:14.650362981 -0600
+++ src/cljs/cljs/analyzer_macros.clj 2012-11-17 13:40:55.563213013 -0600
@@ -0,0 +1,4 @@
+(ns cljs.analyzer-macros)
+
+(defmacro disallowing-recur [& body]
+ `(binding [cljs.analyzer/*recur-frames* (cons nil cljs.analyzer/*recur-frames*)] ~@body))
--- /dev/null 2012-11-27 16:05:14.650362981 -0600
+++ src/cljs/cljs/compiler_macros.clj 2012-11-17 13:40:55.563213013 -0600
@@ -0,0 +1,8 @@
--- /dev/null 2012-11-30 09:18:52.404117001 -0600
+++ src/cljs/cljs/analyzer_macros.clj 2012-12-08 11:13:03.441968192 -0600
@@ -0,0 +1,4 @@
+(ns cljs.analyzer-macros)
+
+(defmacro disallowing-recur [& body]
+ `(binding [cljs.analyzer/*recur-frames* (cons nil cljs.analyzer/*recur-frames*)] ~@body))
--- /dev/null 2012-11-30 09:18:52.404117001 -0600
+++ src/cljs/cljs/compiler_macros.clj 2012-11-17 13:40:55.000000000 -0600
@@ -0,0 +1,8 @@
@kanaka
kanaka / core_test.cljs
Created January 19, 2013 18:18
clojurescript/test/cljs/cljs/core_test.cljs with breaking tests commented out with TODOs
(ns cljs.core-test)
(defn test-stuff []
(println "Starting tests")
;; js primitives
(let [keys #(vec (js-keys %))]
(assert (= [] (keys (js-obj)) (keys (apply js-obj []))))
(assert (= ["x"] (keys (js-obj "x" "y")) (keys (apply js-obj ["x" "y"])))))
@kanaka
kanaka / chrome-app.patch
Created November 8, 2013 13:16
noVNC patch file to add Chrome packaged app support. It uses the Chrome packaged app socket support so it can connect directly to normal TCP VNC servers. This is an old patch and does not cleanly apply to head any longer but the changes needed are probably fairly minor.
diff --git a/include/chrome-app/launcher.js b/include/chrome-app/launcher.js
new file mode 100644
index 0000000..7a5f585
--- /dev/null
+++ b/include/chrome-app/launcher.js
@@ -0,0 +1,11 @@
+console.log(">> launcher.js");
+
+chrome.app.runtime.onLaunched.addListener(function() {
+ chrome.app.window.create('vnc.html', {
@kanaka
kanaka / tokenizer.sh
Last active December 30, 2015 12:18
bash lisp tokenizer NOTE: doesn't handle \" within strings yet
#!/bin/bash
wholefile=$(cat $1)
filelen=${#wholefile}
idx=0
chunk=0
chunksz=500
while true; do
if (( ${#str} < ( chunksz / 2) )) && (( chunk < filelen )); then
@kanaka
kanaka / intListRc.rs
Last active August 29, 2015 13:57
Attempt at List type using Rust std::rc::Rc
// Functional-style integer lists
// Compile with "rustc -o intlistRc intlistRc.rs"
use std::rc::Rc;
enum IntList {
Empty,
Cons(int, Rc<IntList>),
List(~Vector<Rc<IntList>>)
}

Keybase proof

I hereby claim:

  • I am kanaka on github.
  • I am kanaka (https://keybase.io/kanaka) on keybase.
  • I have a public key whose fingerprint is 22BE 1AE2 9383 B209 02E0 F78E 6DA5 BEDC D0BD 70B8

To claim this, I am signing this object:

@kanaka
kanaka / example run
Created February 6, 2015 18:32
Command line (node) version of regPack.js
$ ./regPack.js input.js --crushGainFactor 2 --crushLengthFactor 1 --crushCopiesFactor 0 > output.js
stats: 1851B to 1015B (-836B, -45.16%)
@kanaka
kanaka / gist:728961ce861c81a11bc6
Last active August 29, 2015 14:23
cljs-bootstrap crib sheet
# Step-by-step distilled from: https://github.com/swannodette/cljs-bootstrap
git clone https://github.com/clojure/clojurescript
git clone https://github.com/swannodette/cljs-bootstrap
#git clone https://github.com/clojure/tools.reader
git clone https://github.com/swannodette/tools.reader
cd clojurescript/
./script/build