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 -E -e 's/^/ /g' -e 's/^ --- ?//g' | pandoc -o listing.pdf - | |
That expression is a cheap literate programming system for Markdown. | |
Start commentary lines with '--- ' and they will be | |
markdown-formatted, the rest will be code. (Uses Lua comment syntax.) | |
Finally the right implementation of this idea: | |
http://fresh.homeunix.net/~luke/misc/emacs/pbook.pdf (program) | |
http://fresh.homeunix.net/~luke/misc/erlang/regtest.pdf (better example) |
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 | |
# man.sh - `man` replacement for git bash on windows | |
# Dependencies (outside of git bash): | |
# wget (http://users.ugent.be/~bpuype/wget/) | |
# TODO: | |
# use sed to remove <head> & tags, convert HTML entities |
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
// Can I have two mut references to different parts of a structure | |
// simultaneously? | |
struct Point { | |
x: f64, | |
y: f64, | |
} | |
fn main() { | |
let mut p = Point{x: 3.0, y: 5.0}; |
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
void load_initial_level() { | |
load(0); | |
} | |
void load_next_level() { | |
load(variables.level); | |
} | |
typedef void (*process_loading_func)(); |
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
module Elm where | |
type alias X a = { a | x : Int } | |
type alias XY = X { y : Int } | |
type alias C a = { xs : List (X a) } | |
type alias CXXY = C XY | |
f : C (X XY) -> Int | |
f cxxy = 0 |
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
module Result | |
def Result.capture | |
begin | |
Ok.new(yield) | |
rescue StandardError => e | |
Error.new(e) | |
end | |
end |
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
module Dropdown where | |
import List exposing (..) | |
import Html exposing (..) | |
import Html.Attributes exposing (style) | |
import Html.Events exposing (onClick, onBlur) | |
-- MODEL |
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 Html exposing (text) | |
import String | |
main = | |
text <| toString <| List.map showPlaces <| rewrite rules init | |
type Arrow | |
= Left |
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 Html exposing (text) | |
import Dict exposing (Dict) | |
out = | |
toString >> text | |
main = | |
[1, 2, 3] | |
|> update headL (((+) 3 >> (*) 7) |> Maybe.map) | |
|> set tailL ([1..20] |> Just) |
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 Html exposing (Html) | |
import Html.App as App | |
import Html.Events as Events | |
main = | |
new | |
0 | |
(\diff count -> (diff + count) ! [ Cmd.none ]) |
OlderNewer