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 FormInput from './form-input'; | |
var displayValuePath = 'name'; | |
export default FormInput.extend({ | |
valid: function() { | |
// Values in 'selection' are always promise proxies for models. By this | |
// point, they should *always* be resolved, so _data should have a model in | |
// it (or null). |
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
Connection = require('./irc/connection').Connection | |
exports.load_irc = (req, res, next) -> | |
if req.params.connection? | |
connection_name = decodeURIComponent(req.params.connection) | |
req.connection = Connection.all_connections[connection_name] ? null | |
if req.connection is null | |
res.send(404, 'Connection #{connection_name} could not be found.') | |
if req.params.channel? |
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
project.clj: | |
(... | |
(:dependencies [[org.clojars.amu/libgdx "0.9.2"]]) | |
some file: | |
(ns ... | |
(:import (com.badlogic.gdx ApplicationListener Gdx))) |
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
(defsignal inc-a [a [:a]] [:a] | |
(+ a 1)) | |
;;should generate: | |
(defn inc-a [state_unique_blah] | |
(let [a (get-in state_unique_blah [:a])] | |
(+ a 1)) | |
;;next, I'll rework it to generate something more like |
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
(defsignal inc-a [a :a] :a | |
(+ a 1)) | |
;;should generate: | |
(defn inc-a [state_unique_blah] | |
(let [a (get-in state_unique_blah [:a])] | |
(+ a 1)) | |
;;next, I'll rework it to generate something more like |
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 vectors-to-lookups [state-symbol list-element] | |
(if (vector? list-element) | |
`(get-in ~state-symbol ~list-element) | |
list-element)) | |
(defmacro defsignal [name | |
arg-binds | |
out-path | |
&func] | |
`(defn ~name [state#] |
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
(defmacro test-macro [s] ('a s)) | |
(macroexpand-1 '(test-macro 3)) | |
;;expected: (a 3) | |
;;got: nil |
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 clj-game.core) | |
;; hacky first pass at making a functional style game loop | |
;; | |
;; game state is just a map | |
;; behaviors represent a transformation on a state | |
;;; | |
;; this is a stub of a pong implementation containing two paddles and a ball | |
;; the only behavior in the system moves the ball right by 10 every step |
NewerOlder