Skip to content

Instantly share code, notes, and snippets.

$.Pb = function(a, b, c, d) {
return{textures:{}, materials:xf(xg(function(a, b) {
return new ka(null, 2, [Df, Of.b(Qf.b(b)), Lf, 1 - Tf.b(Qf.b(b))], null);
}, Sd.a(Ce, Z.a(Pf, Q.a(qd, bf(a)))))), geometries:xf(Q.a(qd, Z.a(function(a) {
return function g(a) {
return new V(null, function() {
for (;;) {
var b = E(a);
if (b) {
if (R(b)) {
(let [n nil fizz (cycle [n n "fizz"]) buzz (cycle [n n n n "buzz"]) nums (iterate inc 1)]
(take 20 (map #(if (or %1 %2) (str %1 %2) %3) fizz buzz nums)))
a = m.map(e => m.vector.apply(null, e), a_poly.vertices)
b = m.map(e => m.vector.apply(null, e), b_poly.vertices)
m.equals(m.set(a),
m.set(b))
// you could cache the hash, so whenever and area (or polygon) is created/updated
// you would store the hash on it; inside the poly class (or Area)
v = m.map(e => m.vector.apply(null, e), this.vertices)
macro @ {
case { _ $x } => {
letstx $sx = [makeValue(unwrapSyntax(#{$x}), #{here})];
return #{ Symbol.for($sx) }
}
}
function todoApp(state, action) {
if (state === undefined) state = initialState;
switch (action.type) {
@skrat
skrat / graph.clj
Created August 6, 2015 13:06
Some graph implementations
(ns nines.mesh
(:require [thi.ng.ndarray.core :as nd]))
(defprotocol Graph
(add-node [this x])
(set-edge [this [u v] val])
(get-edge [this [u v]])
(del-edge [this [u v]])
(neighbors [this x]))
@skrat
skrat / foo.glsl
Created September 30, 2015 14:23
// DEPTH
varying vec3 vViewPosition;
vertex:
attribute vec3 position;
uniform mat4 proj;
uniform mat4 view;
float sdPlane(vec3 p, vec4 n) {
// n must be normalized
return dot(p, n.xyz) + n.w;
}
vec3 opTx(mat4 m, vec3 p) {
vec4 q = m * vec4(p, 1.0);
return q.xyz;
}
{:description "FIXME: write description",
:compile-path "/tmp/test/target/classes",
:deploy-repositories
[["clojars"
{:url "https://clojars.org/repo/",
:password :gpg,
:username :gpg}]],
:group "test",
:license
{:name "Eclipse Public License",
import Color exposing (..)
import Graphics.Collage exposing (..)
import Graphics.Element exposing (..)
import Mouse
import Window
import Time
import Signal
main : Signal Element
;; -- clj macros
(defmacro defmodel
([name init [[state & args] & clauses]]
`(defmodel ~name
~(str "Reducing following messages into " name ": "
(clojure.string/join ", " (map first clauses)))
~init ([~state ~@args] ~@clauses)))
([name doc-string init [[state & args] & clauses]]
`(do