Skip to content

Instantly share code, notes, and snippets.

View oamaok's full-sized avatar

Teemu Pääkkönen oamaok

View GitHub Profile
type OptionValue<T> = [] | [T];
type OptionMethods<T> = {
map<A>(fn: (v: T) => A): Option<A>;
filter(fn: (v: T) => boolean): Option<T>;
chain<A>(fn: (v: T) => Option<A>): Option<A>;
exists(fn: (v: T) => boolean): boolean;
fold<A>(onNone: () => A, onSome: (v: T) => A): A;
alt(fn: () => Option<T>): Option<T>;
toNullable(): T | null;
[teemu@xps glass]$ lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 05)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) (rev 05)
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04)
00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem (rev 05)
00:14.0 USB controller: Intel Corporation 100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller (rev 31)
00:14.2 Signal processing controller: Intel Corporation 100 Series/C230 Series Chipset Family Thermal Subsystem (rev 31)
00:15.0 Signal processing controller: Intel Corporation 100 Series/C230 Series Chipset Family Serial IO I2C Controller #0 (rev 31)
00:15.1 Signal processing controller: Intel Corporation 100 Series/C230 Series Chipset Family Serial IO I2C Controller #1 (rev 31)
00:16.0 Communication controller: Intel Corporation 100 Ser
@oamaok
oamaok / dot.js
Last active June 29, 2018 07:27
function composition with `.` in javascript
const accumulator = (fns) => {
const fn = () => {};
fn.fns = fns;
return fn;
}
const handler = {
get: (target, fn) => {
return new Proxy(accumulator([...target.fns, fn]), handler);
},
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC+N205+Z4+O2blzeeYyK01mRfEVG0UFkNV2vN1tMWoT/DSDV0r24RpPxh+V6sDC+OipkODtzp9VKBZNpdl9dfnOIBJw+UbUlDfP4vssKMOVog3mLc0HyKdBtwUyrfScKfGKWfBwmh72as8+rqMJm9p7zuyT/p/GFukiXU3Qul08dZ0uNC/4zBDbaFVIY7Yz3r8YnWXgMKyPuP5Lm4kQ6wIyZEHQ3yF8fsZPmtxNvv6Cl/dt/oafcbprmE0wBQ/tHdRoumUBu39VpCEUzTLyuU5QZF+Q02lpL2L+iD7T5eBAXDgdkY2DhwEk50TeESfD2jDCuN7wIxZJhy8XcYyJbFZt0IWLs30o6qapfNkRpYlmg6IAS8/zkwg9/ySu+joEHagI7oBDljn9Qi1eXQ9MZnSnIjO2gv1XjfsGUfZ5DkKpK7yrdxlpAXSNwlpud6X9ASs8W/MEnBebKKHSk3K37NhS0eGoHjfB3wbi6mPf1g2muCRKiQmrz4GPTGrzAKmBfsAn8AUWAUf0NNlV1GGcKtYvIrqkN/3qFscdd8MSxey1u+CDR/94z/N/9CDi/bI6iUfWMAbSow88YDq3pevIstQst7Ttwlj7rCsGZmcVEw6s4xzYOrnCYSmyJdoTBJPkBb+Dw2pVFv6eb1UD99rCCbwAgEzHiLlapzGUUfXFn/L1Q==
command=$SCRIPT_DIR/$BLOCK_NAME
separator_block_width=15
[layout]
color=#22cc33
interval=5
[battery]
color=#22cc33
label=⚡
rofi.color-enabled: true
rofi.color-window: #393939, #393939, #268bd2
rofi.color-normal: #393939, #ffffff, #393939, #268bd2, #ffffff
rofi.color-active: #393939, #268bd2, #393939, #268bd2, #205171
rofi.color-urgent: #393939, #f3843d, #393939, #268bd2, #ffc39c
{
"color_scheme": "Packages/User/SublimeLinter/itg.dark (SL).tmTheme",
"folder_exclude_patterns":
[
"elm-stuff",
"node_modules",
".git"
],
"font_face": "Monaco",
"font_size": 7,
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
import React from 'react'
import ReactDOM from 'react-dom';
import { createStore, combineReducers } from 'redux';
import { Provider, connect } from 'react-redux';
function increaseBy(amount) {
return {
type: 'INCREMENT',
amount,
};
@oamaok
oamaok / bind.js
Last active October 3, 2017 08:12
function Foo(value) {
this.value = value;
this.bar = function() {
return this.value;
}
this.baz = () => {
return this.value;
}