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> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Hello World!</title> | |
</head> | |
<body> | |
<h1>Hello World!</h1> | |
<!-- All of the Node.js APIs are available in this renderer process. --> | |
We are using Node.js <script>document.write(process.versions.node)</script>, |
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 | |
tail +3 "$0" | clang -x c -o "$0" - && exec "$0" | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <sys/mman.h> | |
#include <mach-o/dyld.h> | |
const char what_good_is_a_writer[] = | |
"What good is a writer if he can’t destroy literature?\n" | |
"And us... what good are we if we don’t help as much\n" |
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
||twitter.com/i/timeline$xhmlhttprequest |
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
0 | |
SECTION | |
2 | |
HEADER | |
9 | |
$ACADVER | |
1 | |
AC1014 | |
9 | |
$HANDSEED |
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
export function App(sources) { | |
const appSinks$ = sources.onion.state$ | |
.startWith({name: null}) | |
.map(state => state.name) | |
// drop repeats to prevent Main() being re-called every time the state changes | |
.compose(dropRepeats()) | |
.map(name => { | |
if (name == null) { | |
return SetName(sources); | |
} else { |
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
tag = (name, text, attrs) -> | |
parts = (name ? 'div').split /(?=[.#])/ | |
tagName = "div" | |
classes = [] | |
id = undefined | |
for p in parts when p.length | |
switch p[0] | |
when '#' then id = p.substr 1 if p.length > 1 | |
when '.' then classes.push p.substr 1 if p.length > 1 | |
else tagName = p |
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
# Needs jq. brew install jq. | |
random_word_def() { | |
local random_word wordnik_for_word show_definition | |
random_word() { | |
perl -e 'rand($.) < 1 && ($line = $_) while <>; print $line' < /usr/share/dict/words | |
} | |
wordnik_for_word() { | |
curl -s http://api.wordnik.com/v4/word.json/"$1"/definitions'?api_key=a2a73e7b926c924fad7001ca3111acd55af2ffabf50eb4ae5' | |
} |
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
component = (c) -> | |
c::_added = (gobj) -> | |
throw 'added twice' if @me? | |
@me = gobj | |
@world = @me.world | |
@init? @_args... | |
new_c = (args...) -> | |
r = new c | |
r._args = args | |
r |
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
{Collection} = masala = require './masala' | |
live = require './sugar' | |
data = new Collection [live { | |
name: 'list of things' | |
data: new Collection [live({val:3}),live({val:4})] | |
}] | |
http = require 'http' | |
render = require './render' |
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
disintegrate = (fn) -> | |
tests = [] | |
ret_fn = (args...) -> | |
args_saved = JSON.stringify(args) | |
res = fn.apply(this, args) | |
res_saved = JSON.stringify(res) | |
tests.push {args:args_saved,res:res_saved} | |
return res | |
ret_fn.tests = tests | |
ret_fn |