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
defaults write -app Skim SKAutoReloadFileUpdate -boolean true |
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
sed ' | |
s/^>// | |
t | |
s/^ *$// | |
t | |
s/^/-- / | |
' in.lhs > out.hs |
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
import * as H from 'sweet.js/helpers' for syntax; | |
syntax m = ctx => { | |
let v = ctx.next().value; | |
if (H.isIdentifier(v, 'foo') { | |
return H.fromString(v, 'bar'); | |
} | |
return H.fromString(v, 'baz'); | |
} | |
m foo; // expands to 'bar' |
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
// log.js | |
'lang sweet.js'; | |
export function log(msg) { | |
console.log(msg); | |
} | |
// main.js | |
import { log } from './log.js' for syntax; | |
syntax m = ctx => { | |
log('doing some Sweet things'); |
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
// foo.js | |
'lang sweet.js'; | |
export syntax m = // ... | |
// main.js | |
'lang sweet.js'; | |
import { m } from './foo'; | |
m // ... |
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
fetch("/foo.json").then(resp => { | |
return resp.json(); | |
}).then(json => { | |
return processJson(json); | |
}); |
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
operator >>= left 1 = (left, right) => { | |
return #`${left}.then(${right})`; | |
} | |
fetch('/foo.json') >>= resp => { return resp.json() } | |
>>= json => { return processJson(json) } |
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
// the web is crazy | |
// http://stackoverflow.com/questions/736513/how-do-i-parse-a-url-into-hostname-and-path-in-javascript | |
function getLocation(href) { | |
var location = document.createElement("a"); | |
location.href = href; | |
// IE doesn't populate all link properties when setting .href with a relative URL, | |
// however .href will return an absolute URL which then can be used on itself | |
// to populate these additional fields. | |
if (location.host == "") { | |
location.href = location.href; |
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
letstx $name ... = [name1, name2, name3]; | |
letstx $type ... ... = [[type1, type2], [type3, type4]] |
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
let function = macro { | |
case { _ * $id ($args ...) { $body ... } } => { | |
var body = #{ $body ... }; | |
var isAwaitGenerator = false; | |
for (var i = 0; i < body.length; i++) { | |
if (body[i].token.type === parser.Token.Identifier && | |
body[i].token.value === 'await') { | |
var expr = getExpr(body.slice(i)); | |
if (expr.success) { | |
isAwaitGenerator = true; |
NewerOlder