Skip to content

Instantly share code, notes, and snippets.

View Janiczek's full-sized avatar

Martin Janiczek Janiczek

View GitHub Profile
@raganwald
raganwald / any-partial-application.js
Created April 1, 2015 15:02
anyPartialApplication
const div = (verbed, numerator, denominator) =>
`${numerator} ${verbed} ${denominator} is ${numerator/denominator}`
div('divided by', 1, 3)
//=> 1 divided by 3 is 0.3333333333333333
const anyPartialApplication = (() => {
const placeholder = {},
anyPartialApplication = (fn, ...template) => {
let remainingArgIndex = 0;
@vancura
vancura / czech.txt
Created May 16, 2011 08:16
Czech unicode range
U+00C1,U+00C9,U+00CD,U+00D3,U+00DA,U+00DD,U+00E1,U+00E9,U+00ED,U+00F3,U+00FA,U+00FD,U+010C,U+010D,U+010E,U+010F,U+011A,U+011B,U+0147,U+0148,U+0158,U+0159,U+0160,U+0161,U+0164,U+0165,U+016E,U+016F,U+017D,U+017E
# These are my notes from the PragProg book on CoffeeScript of things that either
# aren't in the main CS language reference or I didn't pick them up there. I wrote
# them down before I forgot, and put it here for others but mainly as a reference for
# myself.
# assign arguments in constructor to properties of the same name:
class Thingie
constructor: (@name, @url) ->
# is the same as:

Lightning Talk proposal for ReactiveConf 2017 http://www.reactiveconf.com #ReactiveConf

Porting Prezi to Elm in 99 lines of code

Elm is a statically-typed functional programming language. Its compiler produces safe JavaScript which is guaranteed to be free of runtime exceptions. Moreover Elm is packed with a bunch of powerful abstractions which let us build visual and reactive Web applications in a few lines of code.

As an example, I show the implementation of a simple framework for building Prezi-like presentations. It's just 99 lines of code!

@developedby
developedby / ttt.hvm
Created November 3, 2022 13:50
CLI Tictactoe for HVM
// Piece.equal (a: (Piece)) (b: (Piece)) : (Bool)
(Piece.equal (Piece.o) (Piece.o)) = (Bool.true)
(Piece.equal (Piece.x) (Piece.x)) = (Bool.true)
(Piece.equal (Piece.o) (Piece.x)) = (Bool.false)
(Piece.equal (Piece.x) (Piece.o)) = (Bool.false)
// Piece.show (piece: (Piece)) : (String)
(Piece.show (Piece.o)) = "O"
(Piece.show (Piece.x)) = "X"
@peterc
peterc / 16step.coffee
Created February 27, 2012 00:32
Simple 16 step drum machine using CoffeeScript and Node
# Simple 16 step drum machine experiment with Node and CoffeeScript
# by Peter Cooper - @peterc
#
# Inspired by Giles Bowkett's screencast at
# http://gilesbowkett.blogspot.com/2012/02/making-music-with-javascript-is-easy.html
#
# Screencast demo of this code at http://www.youtube.com/watch?v=qWKkEaKL6DQ
#
# Required:
# node, npm and coffee-script installed
@4z3
4z3 / elm-format-wrapper.nix
Created March 24, 2021 00:12
elm-format-wrapper that allows to ignore blocks of code
{ pkgs }:
pkgs.symlinkJoin {
name = "elm-format-wrapper";
paths = [
(pkgs.writers.writeDashBin "elm-format" ''
# elm-format-wrapper 1.0.0
#
# Usage:
# elm-format [--help] [--action=ACTION] PATH...
@JoelQ
JoelQ / elm-types-glossary.md
Last active February 14, 2024 14:29
Elm Type Glossary

Elm Types Glossary

There's a lot of type terminology and jargon going around when discussing types in Elm. This glossary attempts to list some of the most common type terms along with synonyms, terms from other language communities, examples, and links to more detailed articles on each topic.

@charbelrami
charbelrami / elm-grammar.ebnf
Created January 26, 2024 13:41
Elm EBNF grammar
program = [ comment ], [ "port" ], "module", module_name, "exposing", "(", exposed_list, ")", { import_statement }, { declaration }, { comment };
module_name = identifier, { ".", identifier }, [ comment ];
exposed_list = identifier | "(", identifier, { ",", identifier }, ")", [ comment ] | "..";
import_statement = "import", module_name, [ import_alias ], [ "exposing", "(", exposed_list, ")" ], [ comment ];
import_alias = "as", identifier, [ comment ];
declaration = type_declaration
| type_alias_declaration
@klaftertief
klaftertief / reactiveconf-2016-lightning-talk.md
Last active April 2, 2024 20:17
An API search engine in Elm for Elm, proposal for a Lightning Talk at ReactiveConf 2016

An API search engine in Elm for Elm

Elm is a statically typed functional language that compiles to JavaScript. It's well-known for its developer experience: the compiler provides nice error messages, the package system enforces semantic versioning for all published packages and makes sure every exposed value or type has some documentation and type annotations.