Skip to content

Instantly share code, notes, and snippets.

View szabba's full-sized avatar

Karol Marcjan szabba

  • Zielona Góra, Poland
View GitHub Profile
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)
@szabba
szabba / man.sh
Created May 31, 2014 11:52 — forked from lkptrzk/man.sh
#!/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
@szabba
szabba / playground.rs
Created July 24, 2015 19:54 — forked from anonymous/playground.rs
Shared via Rust Playground
// 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};
@szabba
szabba / loading_proces.cpp
Last active September 7, 2015 14:22 — forked from anonymous/sd
void load_initial_level() {
load(0);
}
void load_next_level() {
load(variables.level);
}
typedef void (*process_loading_func)();
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
@szabba
szabba / result.rb
Last active November 18, 2015 18:22
module Result
def Result.capture
begin
Ok.new(yield)
rescue StandardError => e
Error.new(e)
end
end
@szabba
szabba / Dropdown.elm
Created December 27, 2015 16:18 — forked from paparga/Dropdown.elm
Dropdown in Elm
module Dropdown where
import List exposing (..)
import Html exposing (..)
import Html.Attributes exposing (style)
import Html.Events exposing (onClick, onBlur)
-- MODEL
import Html exposing (text)
import String
main =
text <| toString <| List.map showPlaces <| rewrite rules init
type Arrow
= Left
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)
import Html exposing (Html)
import Html.App as App
import Html.Events as Events
main =
new
0
(\diff count -> (diff + count) ! [ Cmd.none ])