Skip to content

Instantly share code, notes, and snippets.

Keith Irwin zentrope

Block or report user

Report or block zentrope

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zentrope
zentrope / file-backed-atom2.clj
Last active Aug 29, 2015
file-backed-atom2.clj
View file-backed-atom2.clj
(ns afile.core
(:refer-clojure :exclude [deref])
(:require
[clojure.edn :as edn]
[clojure.pprint :refer [pprint]]
[clojure.test :refer [deftest is run-tests]]))
(defn- load-file!
[fname init-value]
(let [f (java.io.File. fname)]
@zentrope
zentrope / gambit-1.clj
Created Mar 20, 2015
agent version of file based atom
View gambit-1.clj
(ns afile.gambit-1
(:refer-clojure :exclude [deref])
(:require
[clojure.edn :as edn]
[clojure.pprint :refer [pprint]]
[clojure.test :refer [deftest is run-tests]]))
(defn- load-file!
[file init-value]
(if (.exists file)
@zentrope
zentrope / gambit-3.clj
Last active Aug 29, 2015
file-atom: core.async, promises, atomic-reference
View gambit-3.clj
(ns afile.gambit-3
(:refer-clojure :exclude [deref])
(:require
[clojure.edn :as edn]
[clojure.pprint :refer [pprint]]
[clojure.core.async :refer [go <! put! chan]]
[clojure.test :refer [deftest is run-tests]]))
(defn- load-file!
[file init-value]
@zentrope
zentrope / alpha3-fail.txt
Last active Aug 31, 2015
Stacktrace when compiling ClojureScript 1.7.122 with Clojure 1.8.0-alpha3 (also alpha4). Alpha2 works. Same error with JDK7 or 8.
View alpha3-fail.txt
Compiling ClojureScript...
Exception in thread "main" java.lang.VerifyError: (class: cljs/util$last_modified, method: invokeStatic signature: (Ljava/lang/Object;)Ljava/lang/Object;) Can only throw Throwable objects, compiling:(util.cljc:142:1)
at clojure.lang.Compiler$DefExpr.eval(Compiler.java:468)
at clojure.lang.Compiler.eval(Compiler.java:6948)
at clojure.lang.Compiler.load(Compiler.java:7390)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.loadResourceScript(RT.java:363)
at clojure.lang.RT.load(RT.java:453)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5436.invoke(core.clj:5869)
View Kernel.scala
package com.zentrope {
import scala.actors.Actor
import scala.actors.TIMEOUT
import scala.concurrent.Lock
import scala.concurrent.ops.spawn
import scala.util.Random
View gist:542991
base_dir = Dir.pwd
build_dir = "#{base_dir}/build"
src_dir = "#{base_dir}/src"
lib_dir = "#{base_dir}/lib"
def classpath(location)
places = File.join(location, "*.jar")
return Dir.glob(places).join(":")
end
View httpd.py
#!/usr/bin/env python
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import urllib2
import base64
import cgi
from xml.etree.ElementTree import XML
class Cws:
View main.py
#!/usr/bin/env python
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp import WSGIApplication
from google.appengine.api import memcache
from google.appengine.ext import db
View par.el
-module(par).
-compile(export_all).
%% Just some experiments in parallel processing.
test_job() ->
Parent = self(),
spawn(fun() ->
do_job(Parent, {job, make_ref()})
View hornet.scala
package zentrope.hornet {
// This is a small app to see what it's like to work with
// HornetQ messaging in a Scala context. The main things I'm
// interested in are making working with HornetQ itself as a
// resource easier, and making confience methods, classes, data
// structures easier for anyone using this code.
import scala.actors._
import scala.concurrent.ops.spawn
You can’t perform that action at this time.