Skip to content

Instantly share code, notes, and snippets.

@holyshared
holyshared / .editorconfig
Last active April 21, 2020 02:12
DataLoader
[*.js]
indent_style = space
indent_size = 2
@holyshared
holyshared / and.js
Created February 12, 2020 02:45
and.js
const a = [1, 2, 4];
const b = [1, 2, 3, 4];
const c = [ 2, 3, 4];
const _and = (a, b) => a.filter(v => b.includes(v));
const and = (...values) => {
const first = (values.length > 0) ? values[0] : [];
return values.reduce((acc, v) => _and(acc, v), first);
};
node_modules
@holyshared
holyshared / .gitignore
Last active July 6, 2020 02:38
apollo-upload-client for example
node_modules
@holyshared
holyshared / Makefile
Last active June 29, 2023 11:14
Design-for-testability - OCaml version
.PHONY: all clean test
all:
ocamlfind ocamlopt -o main -package unix -linkpkg greeter.mli greeter.ml app.ml main.ml
ocamlfind ocamlopt -o test_greeter -package unix -linkpkg greeter.mli greeter.ml app.ml test_greeter.ml
clean:
rm test_greeter main greeter.cm* greeter.o app.cm* app.o test_greeter.cm* test_greeter.o main.cm* main.o
test: all
node_modules

Locator

Mongoose

Omit keys from an object

@holyshared
holyshared / .editorconfig
Last active July 29, 2019 03:11
File size
[*.html,*.mjs,*.js]
indent_style = space
indent_size = 2