This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var Promise = require("bluebird"); | |
var fs = Promise.promisifyAll(require('fs')); | |
var app = express(); | |
function pipe() { | |
return [].reduce.call(arguments, function(red, p) { | |
return red.then(p); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xs.unshift(0).zip(xs.push(1)).map ([a, b]) -> ... | |
vs. | |
(->> (zip (cons 0 xs) | |
(conj xs 1)) | |
(map (fn [[a, b]] ...))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def geometry_mat(self, b_obj, b_mat): | |
bpy.ops.object.material_slot_add() | |
b_obj.material_slots[0].link = 'OBJECT' | |
b_obj.material_slots[0].material = b_mat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; CLJ | |
(defn browser-repl [] | |
(let [repl-env (weasel/repl-env :ip "0.0.0.0" :port 9001)] | |
(piggieback/cljs-repl :repl-env repl-env) | |
(piggieback/cljs-eval {} repl-env '(in-ns 'sketcher.core) {}))) | |
;; CLJS | |
(weasel/connect "ws://localhost:9001" :verbose true :print #{:repl :console}) | |
;; project.clj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function start(){ | |
// save the context state | |
ctx.save(); | |
// draw the overlay | |
ctx.drawImage(overlay,150,35); | |
// change composite mode to source-in | |
// any new drawing will only overwrite existing pixels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped = (function run_state_machine_wrapped(state){ | |
try{return cljs.core.async.impl.ioc_helpers.run_state_machine.call(null,state); | |
}catch (e25988){if((e25988 instanceof Object)){ | |
var ex = e25988; | |
cljs.core.async.impl.protocols.close_BANG_.call(null,cljs.core.async.impl.ioc_helpers.aget_object.call(null,state,cljs.core.async.impl.ioc_helpers.USER_START_IDX)); | |
console.error(ex); // <--- | |
throw ex; | |
} else { | |
throw e25988; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.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)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |