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
Figwheel: Starting server at http://localhost:3449 | |
Figwheel: Watching build - dev | |
[0mCompiling "resources/public/js/compiled/app.js" from ["src"]... | |
{:file #object[java.net.URL 0x60648aad "file:/home/dan/dev/org/danjoe/game/src/game/procedural/hero.cljs"], :line 1, :column 1, :tag :cljs/analysis-error} | |
ANALYSIS ERROR: at line 1 file:/home/dan/dev/org/danjoe/game/src/game/procedural/hero.cljs on file file:/home/dan/dev/org/danjoe/game/src/game/procedural/hero.cljs, line 1, column 1 | |
Subprocess failed | |
clojure.lang.ExceptionInfo: Error in component :figwheel-system in system com.stuartsierra.component.SystemMap calling #'com.stuartsierra.component/start {:reason :com.stuartsierra.component/component-function-threw-exception, :function #'com.stuartsierra.component/start, :system-key :figwheel-system, :component #figwheel_sidecar.system.FigwheelSystem{:system #object[clojure.lang.Atom 0x3191ba8b {:status :ready, :val #<SystemMap>}]}, :system #<SystemMap>} | |
at clojure.core$ex_info.invoke(core.clj:4593) | |
at com.st |
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
(defn make-canvas [width height] | |
(let [canvas (.createElement js/document "canvas") | |
context (.getContext canvas "2d")] | |
(set! (.-width canvas) width) | |
(set! (.-height canvas) height) | |
{:canvas canvas | |
:context context})) | |
(defn set-key [key-state pressed? event] | |
(swap! key-state (.-which event) pressed?)) |
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 counter (atom 0)) | |
(def btn-inc (.createElement js/document "button")) | |
(def btn-dec (.createElement js/document "button")) | |
(def count-now (.createElement js/document "span")) | |
(set! (.-innerText btn-inc) "+")) | |
(set! (.-innerText btn-dec) "-")) | |
(defn init! [] |
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 app = {}; | |
// go through the application and find every single instance of a div | |
// with the class of 'sandbox' | |
app.bootstrap = function() { | |
var sandboxes = document.getElementsByClassName('sandbox'); | |
// for each sandbox, run the createSandbox function | |
[].forEach.call(sandboxes, app.createSandbox); | |
}; |
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 fib(x) { | |
fib.memo = fib.memo || {}; | |
if(x <= 0) return 1; | |
return fib.memo[x] || | |
(fix.memo[x] = fib(x - 1) + fib(x - 2); | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- Object Format Tests --> | |
<script src='tiles.js'></script> | |
<!-- Binary Format Tests --> | |
<!--<script src='tiles-binary.js'></script>--> | |
</head> | |
<body> | |
</body> |
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
import Component from './component'; | |
import { curry, compose } from 'functional'; | |
const map = (collection, func) => { | |
let mappedCollection = new Array(collection.length); | |
collection.forEach((item, index) => { | |
mappedCollection[index] = func.apply(null, arguments); | |
}); | |
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
// javascript has no special syntax for value pipes or function composition. | |
var input = 250; | |
halve(triple(double(input))); | |
// :( | |
// you can often do it with a functional utility library. | |
// it'll look something like this: |
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
[ | |
{ | |
"name": "Top Level Category Name", | |
"icon": "Top level icon", | |
"children": [ | |
{ | |
"name": "Sub category name", | |
"icon": "sub category icon", | |
"cards": [ | |
// ... cards for this category here |
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
#1 > #2 | |
< @A > @B +A,B,C | |
> #C |