Skip to content

Instantly share code, notes, and snippets.

(require 'cljs.repl)
(require 'cljs.closure)
(require 'cljs.repl.browser)
(require 'cljs.repl.node)
(defonce target (first *command-line-args*))
(defonce action (second *command-line-args*))
(defonce build (if (= action "watch")
cljs.closure/watch
@sgrove
sgrove / gamma_lesson_07.cljs
Last active August 29, 2015 14:21
Compare "Learn WebGL 07" with "Learn Gamma 07"
;; NB: Missing the html controls to edit the parameters,
;; will add them in later for a fair comparison
(ns gampg.learn-gamma.lesson-07
(:require [clojure.string :as s]
[gamma.api :as g]
[gamma.program :as p]
[gamma.tools :as gt]
[gamma-driver.drivers.basic :as driver]
[gamma-driver.protocols :as dp]
[goog.webgl :as ggl]
@sgrove
sgrove / learn_gamma.cljs
Last active August 29, 2015 14:21
Compare "Learn WebGL Lesson 1" with "Learn Gamma Lesson 1"
;; Gamma (shader-generation): https://github.com/kovasb/gamma
;; Gamma Driver (WebGL resource management, aka "Om for WebGL"): https://github.com/kovasb/gamma-driver
;; Gamma examples: https://github.com/kovasb/gamma-examples
(ns gampg.learn-gamma.lesson-01
(:require [clojure.string :as s]
[gamma.api :as g]
[gamma.program :as p]
[gamma.tools :as gt]
[gamma-driver.drivers.basic :as driver]
// Some of this is just preference, as you can do it in stuff like Rx
// as well but I find that this style scales better for readable code.
// Channels only provide a few operations like `take` (`<!` in CLJS)
// and don't care how your event loop is run. You manually create
// loops, as in `go-loop` in ClojureScript:
(go-loop [last-x 0]
(let [x (<! x-chan)]
(if (not (= x last-x))
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[Unit]
Description=cAdvisor Service
After=docker.service
Requires=docker.service
[Service]
Restart=always
ExecStartPre=-/usr/bin/docker kill cadvisor
ExecStartPre=-/usr/bin/docker rm -f cadvisor
ExecStartPre=/usr/bin/docker pull google/cadvisor
ExecStart=/usr/bin/docker run --name cadvisor --volume=/var/run:/var/run:rw --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro --publish=4194:4194 google/cadvisor --logtostderr --port=4194
@donpdonp
donpdonp / wmb.md
Last active December 25, 2015 15:09
Web Message Bus

Web Message Bus notes (Oct 2013)

Description

a message bus for http requests and responses. hanging off the bus are webapps and http listeners. routing table is modified at runtime. the start script for apps and listeners are part of the configuration (services endure, like node's forever)

Components

  • Bus = nanomsg
  • Webapp: Rails, Node, etc (anything with a nanomsg lib)
  • HTTP Listener: nginx module
  • Distributed routing config with coreos/etcd
@whilo
whilo / clj-like-func-data-fns
Created November 22, 2013 01:30
Clojure like functional data functions for hy sketch.
(import [pysistence [make_list make_dict]])
(defn atom [init-val])
(defn swap! [atom fn])
(defn massoc [as k v]
(kwapply (as.using) {k v}))
@mfikes
mfikes / scljs.md
Last active December 29, 2015 10:47
State of ClojureScript

If you look at the 2014 State of ClojureScript survey, these are the top items for What has been most frustrating for you in your use of CLJS?, and my take on work done in these areas is below. It is nothing short of amazing, IMHO.

Therefore I urge you to do the current survey.

  1. Difficulty using ClojureScript REPL: The Node.js REPL was added, as well as a Nashorn REPL, as well as a lot of new "ease-of-use" stuff baked into all base REPLs (doc, pst, etc.). Additionally, a few new ClojureScript REPLs (Ambly, Replete, Planck) rely heavily on new stuff in ClojureScript.
  2. Difficulty debugging generated JavaScript: Source map capability was essentially extended to all REPLs with stack traces automatically being mapped. The
@rm-hull
rm-hull / EARTH.md
Last active March 11, 2016 02:22
ClojureScript & WebGL integration by way of PhiloGL.js - an interactive spheroid. Modified from https://github.com/tsaastam/cljs-webgl-example