Skip to content

Instantly share code, notes, and snippets.

View AlexanderShushunov's full-sized avatar

Alexander Shushunov AlexanderShushunov

View GitHub Profile
@simonprickett
simonprickett / env.yaml
Created July 17, 2018 04:42
Example YAML environment variables file for Google Cloud Functions demo
SUCH_SECRET: Ssssh it's a secret
MANY_ENCRYPTS: rTgHi0444452!
SO_FINALLY_CAUGHT_UP_WITH_AWS: Oh yess
@unlabeled
unlabeled / links.md
Created November 23, 2017 07:10
Ссылки для доклада componentDidMount не нужен для MoscowJS #39
@javierarques
javierarques / jsdom-helper.js
Last active January 12, 2022 00:51
Simulate window resize event in jsdom
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const dom = new JSDOM('<!DOCTYPE html><html><head></head><body></body></html>');
global.window = dom.window;
global.document = dom.window.document;
// Simulate window resize event
const resizeEvent = document.createEvent('Event');
@Gozala
Gozala / Readme.md
Last active March 19, 2020 15:09
WTF Flow ?

WTF Flow

[Flow][] static type checker is a wonderful attempt to bring [algebric data types][] to JS. It is still fairly new project and there for has few WTFs that can pull you down the rabbit hole. This document is attempt to document things that may seem like a WTF from the perspective of JS developer who tries to employ static type checker, or in other words, some items on the list may be very subjective & based on the background of the writer.

Polymorphic type that is a function

It is very likely that one will wind up using [Polymorphic functions][] to solve a more general problem. And if you define type alias for such a function you may be puzzled what is the right syntax should be used for such type definition.

Let's start with: