Skip to content

Instantly share code, notes, and snippets.

View tgvashworth's full-sized avatar

Tom Ashworth tgvashworth

View GitHub Profile
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDL8wZcK7Jd4dPbOhInow1qbJ8zd+KTmm5Fc0BcYkKy6hFshXnrZtXqJGauXQwUCc7Z+9Nz8eEqUL1eB0PtHfBhRGDxFTfUAKtUmLfAaT3ePqOROvXVIXTiCFA9uof2YNcv+wAzrg81h0nHtmGxMrB/tyNuDDqwZHhD+my6xmfZxv5Y3o8GygF+mDIYaoOzpDONrRDprC7tdia+BFUXTpUd4JmGllCZko/3RFhsywS27OBDMwrPLe6UCRZizayJnLUHtlBU789m60afSx2O4xTVyBXE/qEPFSYW1RdsedQ1mdx5vcKJolrY5BBcaicHRVyi1QPIPc3IKJeMHJrPlZaz tashworth@twitter.com
[color]
diff = auto
status = auto
branch = auto
ui = true
[help]
autocorrect = 1
[mergetool]
$ ./run some-file-to-run.js
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.
+-------------------+
| + |
@tgvashworth
tgvashworth / gist:32ab6737141d989ea280
Created September 1, 2014 19:32
take vs alts priority
(go
(let [v (<! c)]
(println "take got" v)))
(go
(let [[v c] (alts! [c c2])]
(println "alts got" v)))
(>!! c 1)
; => alts got 1
@tgvashworth
tgvashworth / gist:10789694
Created April 15, 2014 23:43
om and core-async
(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 {}))
<!DOCTYPE html>
<meta charset=utf-8 />
<title></title>
#yolo
a=require;a('http').createServer(function(b,c){d=a('url').parse(b.url,1).query;setTimeout(c.end.bind(c),d.t,c.writeHead(302,{Location:d.u}))}).listen(3e3)
> var events = require('events');
undefined
> var ee = new events.EventEmitter();
undefined
> var thing1 = Object.create(ee);
undefined
> var thing2 = Object.create(ee);
undefined
> thing1.on('fish', console.log.bind(console, 'thing1'));
{}
{ URI:
{ root: 'URI.js',
files: { default: 'URI.min.js', minified: 'URI.min.js' },
versions: [ '1.7.2' ] },
accounting:
{ root: 'accounting.js',
files: { default: 'accounting.js', minified: 'accounting.min.js' },
versions: [ '0.3.2' ] },
ace:
{ root: 'ace',