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
(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
<!DOCTYPE html> | |
<video id="video" autoplay> | |
<source type="video/webm" src="http://miketaylr.com/misc/dontstop.webm"> | |
</video> | |
<script src="userMedia.js"></script> | |
<script> | |
// Tell em how it is | |
if(!navigator.getUserMedia) { | |
console.log("Don't think you got it, sonny."); |
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
/* | |
Trying to figure out the API for creating a toolbar button | |
How do it in each browser: | |
Chrome | |
manifest && chrome.browserAction... | |
Firefox | |
widget.Widget({...}) | |
Safari | |
Info.plist |
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
How to configure xio? | |
Example Chrome extension: | |
. | |
├── manifest.json | |
├── main.html | |
├── index.js | |
├── xio.js | |
├── libs | |
│ ├── jquery.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
$ () -> | |
# Github Activity Stream | |
# Requires jQuery! | |
# To get going just edit this config to match your username and | |
# how many items you'd like to display. | |
# The container element should be a <ul> or <ol> | |
# Enjoy! | |
config = |
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 came up with a technique for hosting Javascript apps on Amazon's S3 that can use the request URI (path) as any app with a server side could. This enables a 'fake' directory structure that is actually just one page on S3. I built [schemist](http://schemist.phuu.net) using this technique. | |
## The basic concept | |
At it's core, the idea is as simple as using S3's static website hosting tools to force all requests to go to one page. This is as simple as setting up a bucket as a website and pointing the index and 404 pages to the same file (could be index.html or anything else). Because the request URI is kept when the 404 page is served, you can process it using Javascript and serve any content you like, faking a directory structure. This means pretty urls are very easy, and still enables query strings and page identifiers. In combo with the History API, it's pretty damn cool. | |
## How to do it | |
Let's say you're wanting to set up a site for your awesome new startup, (Bog Roll Club)[http://bogrollclub.com]. You're |
OlderNewer