Source: https://cs.au.dk/~hosc/local/LaSC-4-3-pp223-242.pdf
Sometimes the behavior of an instance of a data type can be divided into several different “modes” of behavior or implementation…
| ;; 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] |
Source: https://cs.au.dk/~hosc/local/LaSC-4-3-pp223-242.pdf
Sometimes the behavior of an instance of a data type can be divided into several different “modes” of behavior or implementation…
| /* | |
| * based on https://gist.github.com/sebmarkbage/fac0830dbb13ccbff596 | |
| * by Sebastian Markbåge | |
| */ | |
| import React from 'react'; | |
| const noop = () => {}; | |
| const es6ify = (mixin) => { | |
| if (typeof mixin === 'function') { |
| echo "Flipping tables! (╯°□°)╯︵ ┻━┻" | |
| num_rules=3 | |
| real=3 # exposed to the ELB as port 443 | |
| test=4 # used to install test certs for domain verification | |
| health=5 # used by the ELB healthcheck | |
| blue_prefix=855 | |
| green_prefix=866 |
I've heard this before:
What I really get frustrated by is that I cannot wrap
console.*and preserve line numbers
We enabled this in Chrome DevTools via blackboxing a bit ago.
If you blackbox the script file the contains the console log wrapper, the script location shown in the console will be corrected to the original source file and line number. Click, and the full source is looking longingly into your eyes.
| var Bar1 = base => class extends base { | |
| componentWillMount(){ | |
| super.componentWillMount(); | |
| console.log('Bar1'); | |
| } | |
| }; | |
| var Bar2 = base => class extends base { | |
| componentWillMount(){ | |
| super.componentWillMount(); |
Recent improvements to the ClojureScript compiler have greatly simplified setting up development versus production outputs.
This example uses Figwheel as something that you want to exclude for production, but the pattern is general.
With this simple setup you only need one html file/view and it will work for developement and production.
| # Hello, and welcome to makefile basics. | |
| # | |
| # You will learn why `make` is so great, and why, despite its "weird" syntax, | |
| # it is actually a highly expressive, efficient, and powerful way to build | |
| # programs. | |
| # | |
| # Once you're done here, go to | |
| # http://www.gnu.org/software/make/manual/make.html | |
| # to learn SOOOO much more. |
| function car() { | |
| return { | |
| start: function() { | |
| console.log("Engine on.") | |
| }, | |
| accelerate: function() { | |
| console.log("Let's go!") | |
| } | |
| } | |
| } |