Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Infinigraph, and beyond!

Sean Grove sgrove

💭
Infinigraph, and beyond!
View GitHub Profile
View .merlin
S .
B _build
PKG core
PKG core_kernel
Pkg async
PKG core_extended
PKG lwt lwt.unix
PKG cohttp
EXT nonrec
View cis194-ex1.hs
module CIS194 where
-- Exercise 1
toDigits :: Integer -> [Integer]
toDigits 0 = []
toDigits x = map read [[c] | c <- show x, x > 0]
toDigitsRev :: Integer -> [Integer]
toDigitsRev = reverse . toDigits
@sgrove
sgrove / modori.js
Created Jan 7, 2015
Modori - Idiomatic Mori
View modori.js
/* Example usage
npm i mori
node modori.js
Most credit for the implementation basis goes to https://github.com/chenglou
*/
var mori = require('mori');
function MoriObj(coll) {
@sgrove
sgrove / Makefile
Created Mar 20, 2015
manual reloadlib target
View Makefile
.PHONY: all clean tower test
DIRTY_FLAG=$(shell git diff-index --quiet HEAD || echo "dirty")
ifeq ($(DIRTY_FLAG),dirty)
DIRTY=true
else
DIRTY=false
endif
all: tower
View ocamlion.md

OCamlion

OCamlion (pronounced oh-camelion) is a static-site generator, useful for blogs and documentation. It relies on git as the underlying state/history mechanism for all source material.

Workflow

OCamlion can be used from either the command line, as a scriptable tool, or inside the browser itself.

Browser workflow

At a high-level, we use Irmin to pull a blog's git repository into the browser and store the raw git history in IndexedDB. We then render both your site and some administration tools in a special editing mode. You can edit and see changes in real-time, save changes locally, and push them to the remote repository when you're finished.

@sgrove
sgrove / lesson_06.cljs
Created May 14, 2015
Learn Gamm 06: Texture filters
View lesson_06.cljs
(ns ^:figwheel-load gampg.learn-gamma.lesson-06
(: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]
[thi.ng.geom.core :as geom]
[thi.ng.geom.core.matrix :as mat :refer [M44]]
@sgrove
sgrove / learn_gamma_09.cljs
Last active Aug 29, 2015
Compare "Learn WebGL 09" with "Learn Gamma 09"
View learn_gamma_09.cljs
(ns gampg.learn-gamma.lesson-09
(: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]
[thi.ng.geom.core :as geom]
[thi.ng.geom.core.matrix :as mat :refer [M44]]
@sgrove
sgrove / learn_gamma.cljs
Last active Aug 29, 2015
Compare "Learn WebGL Lesson 1" with "Learn Gamma Lesson 1"
View learn_gamma.cljs
;; 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]
@sgrove
sgrove / gamma_lesson_07.cljs
Last active Aug 29, 2015
Compare "Learn WebGL 07" with "Learn Gamma 07"
View gamma_lesson_07.cljs
;; 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]
View chair.gltf
{"accessors":{"accessor_1007":{"bufferView":"bufferView_1595","byteOffset":8048,"byteStride":0,"componentType":5123,"count":30,"type":"SCALAR"},"accessor_1009":{"bufferView":"bufferView_1596","byteOffset":45256,"byteStride":12,"componentType":5126,"count":18,"max":[0.375046,0.177852,0.72784],"min":[0.324467,0.0408841,0.0562498],"type":"VEC3"},"accessor_1011":{"bufferView":"bufferView_1596","byteOffset":45472,"byteStride":12,"componentType":5126,"count":18,"max":[1,0.980105,0.17604],"min":[-1,-0.980105,-0.17604],"type":"VEC3"},"accessor_1013":{"bufferView":"bufferView_1596","byteOffset":45688,"byteStride":8,"componentType":5126,"count":18,"max":[-21.3007,2.61097],"min":[-24.0781,-1.39691],"type":"VEC2"},"accessor_1034":{"bufferView":"bufferView_1595","byteOffset":8516,"byteStride":0,"componentType":5123,"count":24,"type":"SCALAR"},"accessor_1036":{"bufferView":"bufferView_1596","byteOffset":47656,"byteStride":12,"componentType":5126,"count":16,"max":[0.311125,0.18009,0.725909],"min":[0.26035,0.0464297,0.056249