Skip to content

Instantly share code, notes, and snippets.

View hoichi's full-sized avatar
🤔
baffled

Sergey Samokhov hoichi

🤔
baffled
View GitHub Profile
@hoichi
hoichi / counties.json
Last active November 22, 2018 21:22 — forked from rusty-key/counties.json
Countries
[
{"label": "Afghanistan", "value": "af"},
{"label": "Åland Islands", "value": "ax"},
{"label": "Albania", "value": "al"},
{"label": "Algeria", "value": "dz"},
{"label": "American Samoa", "value": "as"},
{"label": "AndorrA", "value": "ad"},
{"label": "Angola", "value": "ao"},
{"label": "Anguilla", "value": "ai"},
{"label": "Antarctica", "value": "aq"},
@hoichi
hoichi / Options.re
Created November 8, 2018 17:07
Experiments with optional parameters in ReasonML
/**
* Trying to figure out types of the optional arguments.
*/
let mandatory = (~s: string) => s;
// let mandatory: (~s: string) => string = <fun>;
let optional = (~s: string=?) => s;
@hoichi
hoichi / Benchmark.ml
Created September 7, 2018 12:46
Benchmarking in OCaml
#require "core_bench";;
open Core_bench;;
[ Bench.Test.create ~let numbers = List.range 0 1000 in
[ Bench.Test.create ~name:"sum_if" (fun () -> ignore (sum_if numbers))
; Bench.Test.create ~name:"sum" (fun () -> ignore (sum numbers)) ]
|> Bench.bench
;;
(* from https://dev.realworldocaml.org/lists-and-patterns.html#performance *)
@hoichi
hoichi / Main.elm
Last active April 1, 2017 05:20
Nested subscriptions?
module Main exposing (..)
import Config exposing (..)
import Storage exposing (..)
--
import Html exposing (..)
@hoichi
hoichi / poorman_flexbox.css
Created September 24, 2015 11:28
A poor man's flexbox
/* © http://codepen.io/chriscoyier/pen/nfyGk */
#container {
text-align: justify;
font-size: 0.1px; /* IE 9 & 10 don't like font-size: 0; */
min-width: 600px;
}
#container div {
width: 150px;
height: 125px;
@hoichi
hoichi / LICENSE.txt
Last active August 29, 2015 14:24 — forked from 140bytes/LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE