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 createComponent(def) { | |
return React.createComponent({ | |
render: function () { | |
return def.render(this.props); | |
} | |
}); | |
} |
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 createSearchBox(data, service) { | |
var Input = React.createComponent({ | |
render: function () { | |
return React.DOM.input({ | |
onClick: function () { | |
service.doStuff(); | |
} | |
}); | |
} | |
}); |
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
(ns java-clj.core) | |
(defn java-1 [form] | |
(if (list? form) | |
(let [tail (map java-1 (rest (rest form)))] | |
(if (< 2 (count form)) | |
`(~(second form) ~(first form) ~@tail) | |
`~form)) | |
form)) |
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
<body> | |
<style> | |
/* Basic reset */ | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
table { | |
width: 100%; |
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
/* Basic reset */ | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
table { | |
width: 100%; | |
border-collapse: collapse; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 target = document.getElementById("puzzle-container"); | |
var picture = target.getElementsByTagName("img")[0].src; | |
function render(game, player) { | |
var puzzleUI = Pizuzzle({ | |
layout: player.layout, | |
picture: player.picture, | |
move: function (slot) { | |
game.move(player, slot.id); | |
render(game, player); |
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 page [] | |
(enlive/sniptest (slurp (io/resource "index.html")) | |
[:body] (enlive/append | |
(enlive/html [:script (browser-connected-repl-js)])))) |
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
// An innocent-looking function | |
function getInjected(lol) { | |
console.log(lol); | |
} | |
var di = initializeDI(); | |
di.add("lol", 42); | |
// A pretty weird function call | |
di.invoke(getInjected); // "42" |
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
<head></head> | |
<body> | |
<script> | |
document.head.innerHTML += "<meta charset=\"utf-8\">"; | |
document.body.innerHTML += "✓"; | |
</script> | |
</body> |