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
(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
(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
<!DOCTYPE html> | |
<meta charset=utf-8 /> | |
<title></title> | |
#yolo |
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
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) |
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 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')); | |
{} |
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
{ 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', |
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 (scope, name, fn, map) { | |
if (typeof define === 'function' && define.amd) { | |
define(fn) | |
} else if (typeof exports === 'object') { | |
var rtn = fn(require, module.exports, module); | |
if (module.exports !== rtn && | |
typeof rtn !== 'undefined') module.exports = rtn; | |
} else { | |
var exp = {}, mod = { exports: exp }, | |
reqr = function (i) { return map[i] ? scope[map[i]] : scope[i]; }; |
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
/** | |
* Defer callable. Kinda tricky to explain. Basically: | |
* "Don't make newFn callable until I tell you via this trigger callback." | |
* | |
* Example: | |
// Only start logging after 3 seconds | |
var log = function (str) { console.log(str); }; | |
var deferredLog = deferCallable(log, function (done) { | |
setTimeout(done, 3000); |
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
#!/bin/sh | |
# install: | |
# cd /usr/local/bin && wget -O stage-me https://gist.github.com/phuu/5704768/raw/gistfile1.sh && chmod u+x stage-me | |
branch=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3-` | |
echo "Merging ⭠ $branch into ⭠ staging." | |
read -p "Is this correct? [y/N] : " -r | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then |