Skip to content

Instantly share code, notes, and snippets.

View brainrake's full-sized avatar
λ ék .

Márton Boros brainrake

λ ék .
  • Budapest, Hungary
View GitHub Profile
mg = require 'mongoose'
Global = new mg.Schema
progress: String
RecipeUpload = new mg.Schema
lang: type: String, index: yes
filename: type: String, index: yes
contents: Buffer
import Html exposing (Html, div, text)
-- give a name to an extensible record with fields common to all ducks
type alias Duck a = { a | name : String
, color : String }
-- operation common to all ducks
module Main where
import Prelude
import Control.Monad.Eff.Console (log)
-- give a name to an extensible record with fields common to all ducks
type Duck a = { name :: String
, color :: String | a }
module Main where
import Prelude
import Control.Monad.Eff.Console (log)
-- give a name to an extensible record with fields common to all ducks
type Duck a = { name :: String
, color :: String | a }
@brainrake
brainrake / buttons.js
Created January 12, 2017 22:08
model-view-update in js
<html>
<body>
<script src="https://gitcdn.xyz/repo/Matt-Esch/virtual-dom/master/dist/virtual-dom.js"></script>
<script>
var h = require('virtual-dom/h');
var diff = require('virtual-dom/diff');
var patch = require('virtual-dom/patch');
var createElement = require('virtual-dom/create-element');
@brainrake
brainrake / config.toml
Created January 29, 2017 15:46
gitlab runner config to run under nixos with shared nix store
concurrent = 32
check_interval = 3
[[runners]]
name = "ci"
url = "https://gitlab.com/ci"
token = "${gitlab_runner_token}"
executor = "docker"
environment = ["NIX_REMOTE=daemon", "NIX_PATH=nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixpkgs"]
pre_build_script = "export PATH=$PATH:/run/current-system/sw/bin; unset SSL_CERT_FILE; unset GIT_SSL_CAINFO"
[runners.docker]
@brainrake
brainrake / Machine.elm
Last active January 31, 2017 10:58
simple type-level state machine in elm. invalid tra
module Machine exposing (..)
type DoorState = Opened | Closed
type ClosedDoor = ClosedDoor DoorState
type OpenedDoor = OpenedDoor DoorState
@brainrake
brainrake / a.hs
Created January 31, 2017 11:39
head of empty list in haskell
main = print $ show $ head []
{pkgs ? import <nixpkgs> {}, ...}:
pkgs.stdenv.mkDerivation {
name = "a-slower-speed-of-light";
src = pkgs.fetchurl {
url = http://web.mit.edu/gambit/summer12/speedoflight/beta/A_Slower_Speed_of_Light.tgz;
sha256 = "095kbvpjwzllm0p0c92100vsk40fdrxp2ak3wvdbmk3vzfvbxb6v";
};
installPhase = with pkgs; ''
@brainrake
brainrake / session.txt
Created June 27, 2017 10:25
structural editor interactive session
<"ul" space>
ul _[]_ []
^ List (Attribute msg)
<space>
ul [] _[]_
^ List (Html msg)
<">">