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 om-do.core | |
(:require-macros [cljs.core.async.macros :refer [go]]) | |
(:require [om.core :as om :include-macros true] | |
[om.dom :as dom :include-macros true] | |
[cljs.core.async :refer [put! <! >! chan timeout alts!]])) | |
(enable-console-print!) | |
(def app-state | |
(atom {})) |
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
(go | |
(let [v (<! c)] | |
(println "take got" v))) | |
(go | |
(let [[v c] (alts! [c c2])] | |
(println "alts got" v))) | |
(>!! c 1) | |
; => alts got 1 |
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
I want a box that contains some text and an image or icon. | |
The icon should sit just to the right of the text, unless the text+image fills the width of the box. | |
The text should then finish with ellipsis, but the icon should stay in a fixed position. | |
The surrounding box should fill multiple fixed-width containers. | |
+-------------------+ | |
| + | |
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
$ ./run some-file-to-run.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
[color] | |
diff = auto | |
status = auto | |
branch = auto | |
ui = true | |
[help] | |
autocorrect = 1 | |
[mergetool] |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDL8wZcK7Jd4dPbOhInow1qbJ8zd+KTmm5Fc0BcYkKy6hFshXnrZtXqJGauXQwUCc7Z+9Nz8eEqUL1eB0PtHfBhRGDxFTfUAKtUmLfAaT3ePqOROvXVIXTiCFA9uof2YNcv+wAzrg81h0nHtmGxMrB/tyNuDDqwZHhD+my6xmfZxv5Y3o8GygF+mDIYaoOzpDONrRDprC7tdia+BFUXTpUd4JmGllCZko/3RFhsywS27OBDMwrPLe6UCRZizayJnLUHtlBU789m60afSx2O4xTVyBXE/qEPFSYW1RdsedQ1mdx5vcKJolrY5BBcaicHRVyi1QPIPc3IKJeMHJrPlZaz tashworth@twitter.com |
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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
window.$ = require('jquery'); | |
var component = require('flightjs').component; | |
var withState = require('flight-with-state'); | |
var ToggleButton = component(withState, function ToggleButton() { | |
this.attributes({ | |
enabledMessage: 'Enabled', |
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
window.$ = window.jQuery = require("jquery"); | |
var flight = require("flightjs"); | |
var withState = require("flight-with-state"); | |
var redux = require("redux"); | |
var createStore = redux.createStore; | |
function counter(state, action) { | |
state = state || 0; | |
switch (action.type) { |
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 _ = require("lodash"); | |
window.$ = window.jQuery = require("jquery"); | |
var flight = require("flightjs"); | |
var withState = require("flight-with-state"); | |
var redux = require("redux"); | |
var createStore = redux.createStore; | |
var combineReducers = redux.combineReducers; |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |