Skip to content

Instantly share code, notes, and snippets.

View shinzui's full-sized avatar
👨‍💻

Nadeem Bitar shinzui

👨‍💻
  • Los Angeles / San Francisco
  • X @shinzui
View GitHub Profile
title author
Glassery
Oleg Grenrus

After I have improved the raw performance of optika – a JavaScript optics library, it's time to make the library (feature-)complete and sound. Gathering and classifying all possible optic types, gives us a reference point

@shinzui
shinzui / GraphqlHooks.re
Created March 31, 2019 18:57 — forked from sync/GraphqlHooks.re
Hooks reason graphql
module MemCache = {
type t;
[@bs.deriving abstract]
type config = {initialState: Js.Json.t};
type conf = Js.Json.t;
[@bs.module "graphql-hooks-memcache"]
external _createMemCache: config => t = "default";
@shinzui
shinzui / p2.csv
Last active November 1, 2018 00:46
propertyId agentId
132 50000
99 50001
105 50002
120 50002
58 50003
46 50005
65 50006
66 50006
118 50011
@shinzui
shinzui / p.csv
Last active November 1, 2018 00:08
buyerNeedId agentId
293 2324
313 1531
@shinzui
shinzui / test.csv
Last active October 30, 2018 23:08
propertyId agentId
1 123
2 333
@shinzui
shinzui / RecursiveGQLTypes.re
Created October 12, 2018 03:53 — forked from kgoggin/RecursiveGQLTypes.re
This gist shows how you could go about defining ReasonML types based on a GraphQL schema that reference each other, as well as a recursive decoder function used to parse a JSON response into the correct type.
/* Use Reason's ability to define recursive types with the `and` keyword */
type movie = {
id: option(string),
name: option(string),
rating: option(Js.null(string)),
runTime: option(Js.null(int)),
actors: option(list(actor)),
}
and actor = {
id: option(string),
@shinzui
shinzui / App.re
Created September 8, 2018 15:45 — forked from jaredly/App.re
ReasonReact Context API Example
module StringContext =
Context.MakePair({
type t = string;
let defaultValue = "Awesome";
});
let component = ReasonReact.statelessComponent("Tree");
let make = _children => {
@shinzui
shinzui / Dockerfile
Created August 27, 2018 04:50 — forked from rizo/Dockerfile
FROM ocaml/opam2:alpine-3.7-ocaml-4.06
RUN sudo apk --no-cache add ca-certificates
RUN sudo apk add --update m4 openssh-client
# Setup SSH.
RUN mkdir -p ~/.ssh
ARG SSH_PRIVATE_KEY
RUN echo "${SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa
RUN chmod 600 ~/.ssh/id_rsa
RUN printf "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
@shinzui
shinzui / config
Created August 23, 2018 02:55 — forked from Khady/config
Opam configuration for both sandbox and compilation cache
pre-install-commands:
["opam-bin-cache.sh" "restore" build-id name] {?build-id}
wrap-build-commands: [
["opam-bin-cache.sh" "wrap" build-id] {?build-id}
["%{hooks}%/sandbox.sh" "build"] {os = "linux"}
]
wrap-install-commands: [
["opam-bin-cache.sh" "wrap" build-id] {?build-id}
["%{hooks}%/sandbox.sh" "install"] {os = "linux"}
]
@shinzui
shinzui / combinators.js
Created March 3, 2018 03:42 — forked from Avaq/combinators.js
Common combinators in JavaScript
const I = x => x;
const K = x => y => x;
const A = f => x => f(x);
const T = x => f => f(x);
const W = f => x => f(x)(x);
const C = f => y => x => f(x)(y);
const B = f => g => x => f(g(x));
const S = f => g => x => f(x)(g(x));
const P = f => g => x => y => f(g(x))(g(y));
const Y = f => (g => g(g))(g => f(x => g(g)(x)));