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
public class Main { | |
public void foo() { | |
System.out.println("Foo!"); | |
} | |
public static void main(String[] args) { | |
new Main().foo(); | |
} | |
} |
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 Data.List | |
data Coin = Coin Integer String | |
instance Show Coin where | |
show (Coin _ name) = name | |
currency = | |
[ Coin 25 "quarter" | |
, Coin 10 "dime" |
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
object ScalaJSExample extends js.JSApp{ | |
def main() = { | |
val xs = Seq(1, 2, 3) | |
println(xs.toString) | |
val ys = Seq(4, 5, 6) | |
println(ys.toString) | |
val zs = for{ | |
x <- xs | |
y <- ys | |
} yield x * y |
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 suppose my thinking here is that `into` could take either a Lo-Dash | |
// pipeline object or a function. It seems feasible, but I definitely can't | |
// speak to performance implications. It also assumes that `pipeline` doesn't | |
// need to be terminated and that `into` ends method chains. | |
var handle = _.pipeline() | |
.mapValues(s => s.toLowerCase()) | |
.into(p => p.first.charAt(0) + p.last) | |
var jdalton = { first: "John-David", last: "Dalton" } | |
var bmock = { first: "Brian", last: "Mock" } | |
var people = [jdalton, bmock] |
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 freeze = Object.freeze; | |
function array() { | |
return freeze([].slice.call(arguments)); | |
} | |
function array_of_size(n) { | |
var xs = []; | |
while (n-- > 0) { | |
xs.push(null); |
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
#!/usr/bin/env ruby | |
require "nokogiri" | |
root = Nokogiri.parse(File.read("Empty.tmTheme")) | |
scopes = root | |
.css("plist dict array dict key") | |
.select {|key| key.text == "scope" } | |
.map {|key| key.next_element.text } | |
puts scopes |
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 add = TC() | |
.Takes([TC.Number, TC.Number]) | |
.Returns(TC.Number) | |
.By(function(a, b) { return a + b }) | |
var divide = TC() | |
.Takes([TC.Number, TC.Nonzero]) | |
.Returns(TC.Number) | |
.By(function(a, b) { return a / b }) | |
var sum = TC() | |
.Takes([TC.Array(TC.Number)]) |
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>Wobsite</title> | |
</head> | |
<body> | |
<h1>Wobsite</h1> |
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 ( | |
http = require("http"), | |
handler = fn(_req, res) do { | |
res.writeHead(200, {"Content-Type": "text/plain"}); | |
res.end("Hello, world!"); | |
} | |
) do { | |
http.createServer(handler).listen(1337, "127.0.0.1"); | |
print("Server started at http://127.0.0.1:1337/"); | |
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
####### AST ############### | |
[ 'Let', | |
[ 'Ident', 'x' ], | |
[ 'Number', 1 ], | |
[ 'Let', | |
[ 'Ident', 'y' ], | |
[ 'Number', 2 ], | |
[ 'BinOp', | |
'+', |
OlderNewer