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
S .
B _build
PKG core
PKG core_kernel
Pkg async
PKG core_extended
PKG lwt lwt.unix
PKG cohttp
EXT nonrec
@sgrove
sgrove / cis194-ex1.hs
Created November 30, 2014 01:47
CIS194 Ex. 1
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 January 7, 2015 01:38
Modori - Idiomatic Mori
/* 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 March 20, 2015 18:14
manual reloadlib target
.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

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 07:27
Learn Gamm 06: Texture filters
(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.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]
@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_09.cljs
Last active August 29, 2015 14:21
Compare "Learn WebGL 09" with "Learn Gamma 09"
(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]]
{"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