Skip to content

Instantly share code, notes, and snippets.

View Baudin999's full-sized avatar

Baudin999 Baudin999

  • Netherlands
View GitHub Profile
@Baudin999
Baudin999 / ts
Created March 26, 2019 21:05
Currying and Maybe monad in TypeScript
// The Maybe Monad implemented in TypeScript
type Maybe<T> = Nothing<T> | Just<T>
class Just<T> {
a: T;
constructor(a) {
if (a !== null && a !== undefined) this.a = a;
// @ts-ignore
else return new Nothing();
@Baudin999
Baudin999 / Compose
Last active February 18, 2018 09:51
Simple Functional Programming Examples
const log = (arg) => {
console.log(arg);
return arg;
}
const pipe = (...functions) => (...args) => {
if (!Array.isArray(functions)) {
return functions(args);
}
else {
return functions
@Baudin999
Baudin999 / vimrc
Created December 12, 2017 08:05
My simple vimrc
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree'
Plug 'kien/ctrlp.vim'
Plug 'bling/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tpope/vim-fugitive'
Plug 'valloric/youcompleteme'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
@Baudin999
Baudin999 / app.html
Last active September 7, 2016 14:52 — forked from niieani/app.html
Aurelia Compose Containerless Gist
<template>
<ck-container>
<compose repeat.for="item of items"
view="${item.view}.html"
view-model="${item.view}"
model.bind="item.model"
containerless />
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
@Baudin999
Baudin999 / index.html
Last active August 22, 2016 08:37
Memory
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="board">
@Baudin999
Baudin999 / index.html
Last active August 21, 2016 11:19
tic tac toe
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="templates">
@Baudin999
Baudin999 / index.html
Last active August 20, 2016 13:23
Roaman
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
@Baudin999
Baudin999 / index.html
Last active August 20, 2016 11:54
A custom promt
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="console">
@Baudin999
Baudin999 / index.html
Last active August 20, 2016 10:50
Non lineair Questions
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<ul class="answer-container">