Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Location to Timezone</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.0.0/normalize.min.css">
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/0.11.0/fetch.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.10.0/lodash.min.js"></script>
<style>
@Schmavery
Schmavery / little_typer.pie
Created June 16, 2020 06:00
Some exercise code for The Little Typer
#lang pie
(claim + (-> Nat Nat Nat))
(define + (lambda (i j)
(iter-Nat i
j
(lambda (+n-1)
(add1 +n-1)))))
; (+ 1 2)
@Schmavery
Schmavery / syntax.re
Last active January 16, 2020 08:53
bucklescript externals syntax ideas
// The current syntax is followed by one or more alternatives of a different syntax for bsc externals.
// $ is occasionally used as a sort of placeholder, other options like _ or {} could be considered in the same place
[@bs.val] external setTimeout : (unit => unit, int) => float = "setTimeout";
// [@bs] external setTimeout : (unit => unit, int) => float = "setTimeout";
[@bs.scope "Math"] [@bs.val] external random : unit => float = "random";
// [@bs] external random : unit => float = "Math.random";
[@bs.val] [@bs.scope ("window", "location", "ancestorOrigins")] external length : int = "length";
@Schmavery
Schmavery / .vimrc
Created December 16, 2019 02:29
vimrc
set nocompatible
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}}
Plug 'reasonml-editor/vim-reason-plus'
call plug#end()
proof:
((a((x 32380668471615299956444231687282978918093601160918646531377038486000216849940368875332913468302411583505578594983011954347915386674214334677827967257741391361550158709201541665933560869969531292973150149771701999325897561486212)(y 21080266955472926787150993063154124182879463753310427056673858501286476089860215891564780558606568209224955185980020118653075218452029003156348429487762916222270561254484925630208085884965396085563893383378233449769450864167292)(z 1)))(b((x(14164385150309224328696623938005316122520039482374367784769091871556302709128781195551826434927275699920618890739885845925958641054444307203980862870026292494162176106486346439910114358690263754282467504671512813839166847314117 6083521195586423408912836883709317043048939769652109007684858922934493187908024937886950497636085489231386912538352280178589528053596396568440538173950084925884624862560939956166772873441834898558476045148120245465605028882728 37195435825767863692760375343119489826761336486333284646404536687312261069833306972
module BigInt = {
type t = float;
[@bs.val] external ofString: string => t = "BigInt";
[@bs.val] external ofInt: int => t = "BigInt";
external (<): (t, t) => bool = "%lessthan";
external (<=): (t, t) => bool = "%lessequal";
external (>): (t, t) => bool = "%greaterthan";
external (>=): (t, t) => bool = "%greaterequal";
external (==): (t, t) => bool = "%equal";

Keybase proof

I hereby claim:

  • I am schmavery on github.
  • I am schmavery (https://keybase.io/schmavery) on keybase.
  • I have a public key ASAIcMgH64Ax5Qgy4ig_ItVUnVRoG4ZPfIbyY9BWzHVtuQo

To claim this, I am signing this object:

@Schmavery
Schmavery / reason-dojo.md
Last active August 15, 2019 01:25
reason-dojo twitter
  • Go to https://reasonml.github.io/reason-react/ and follow the QuickStart instructions (you don't need to run npm run webpack)
  • Open another shell and run npm run server to start a webserver displaying your site - visit localhost:8000 to see the site.
  • Run npm install reason-urql. This will let you make graphql queries using react hooks.
  • Run npm install graphql_ppx. This will let you construct your graphql queries safely and easily.
  • Open bsconfig.json and add reason-urql to your "bs-dependencies" list (reason-react should already be there).
  • Also add "ppx-flags": ["graphql_ppx/ppx"].
  • Run npx send-introspection-query http://cc265406.ngrok.io/graphql.
  • Check out the examples in the reason-urql to see how to use the hooks. Example query and hook.
  • The graphql server is at `http://cc
@Schmavery
Schmavery / cases.md
Created April 26, 2019 00:01
Foolish imaginings of a world where snake case and camel case live together in harmony

Reason to OCaml:

  • firstsecond => firstsecond
  • firstSecond => first_second
  • first_second => firstSecond
  • first_Second => first_Second

Ocaml to Reason

  • firstsecond => firstsecond
@Schmavery
Schmavery / partial.ml
Created April 25, 2019 17:56
"test cases" and notes for backwards-compatible partial application warning
(** function definition **)
let foo = (fun a b -> a + b)[@num_args 2]
let foo = (fun a b -> a + b)
(* is equivalent to *)
let foo = (fun a -> (fun b -> a + b)[@num_args 1])[@num_args 1]
(** function application **)