Skip to content

Instantly share code, notes, and snippets.

View OlegLustenko's full-sized avatar

Oleg Lustenko OlegLustenko

View GitHub Profile
@OlegLustenko
OlegLustenko / 1.js
Created October 2, 2017 07:30 — forked from kana-sama/1.js
class Nil {}
class Cons { constructor( head, tail) { Object.assign(this, { head, tail }); } };
class Pair { constructor(first, second) { Object.assign(this, { first, second }); } };
const _1 = () => 1;
const _2 = () => 2;
const _3 = () => 3;
const nil = () => new Nil();
const cons = (head, tail) => () => new Cons(head, tail);
@OlegLustenko
OlegLustenko / UIStates.re
Created August 18, 2017 19:33 — forked from busypeoples/UIStates.re
Displaying different UI States nicely in Reason
/* Slaying a UI Anti Pattern in Reason */
type remoteData 'e 'a =
| Nothing
| Loading
| Failure 'e
| Success 'a;
type item = {
userId: int,
@OlegLustenko
OlegLustenko / cloudSettings
Last active December 9, 2017 08:29
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-12-09T08:29:33.415Z","extensionVersion":"v2.8.6"}
@OlegLustenko
OlegLustenko / .hyper.js
Created July 22, 2017 15:54 — forked from fredericmarx/.hyper.js
Configuration file for Hyper https://hyper.is/
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
fontFamily: '"Input Mono", Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
@OlegLustenko
OlegLustenko / prefetch.js
Created July 21, 2017 07:20 — forked from acdlite/prefetch.js
Prefetching in React
function prefetch(getKey, getValue, getInitialValue, propName) {
const inFlight = new Set();
const cache = new Map();
return ChildComponent => {
return class extends React.Component {
state = {value: getInitialValue(this.props)};
componentWillReceiveProps(nextProps) {
const key = getKey(nextProps);
if (cache.has(key)) {
// Use cached value
@OlegLustenko
OlegLustenko / axios-instance-config.js
Created July 7, 2017 10:44 — forked from ccnokes/axios-instance-config.js
Good default configuration for axios in node.js
const axios = require('axios');
const http = require('http');
const https = require('https');
module.exports = axios.create({
//60 sec timeout
timeout: 60000,
//keepAlive pools and reuses TCP connections, so it's faster
httpAgent: new http.Agent({ keepAlive: true }),
@OlegLustenko
OlegLustenko / readme.md
Last active July 4, 2017 12:58
Why Flow instead TypeScript
@OlegLustenko
OlegLustenko / github - basic.md
Last active May 15, 2017 15:04
github instruction

Базовая инструкция github

  1. Качаете нужную для вас версию гитхаба отсюда: https://git-scm.com/download/win

  2. Устанавливаете

  3. Вам необходима только установка GIT отсюда -> https://habrahabr.ru/sandbox/37865/

  4. Далее идете в своего пользователя на github и проделываете эти шаги попорядку:

Home work 1

Уровень сложности 1

Создайте объект который будет содержать:

Представьте, что вы создаете приложение "телефонная книга", а один пользователь, это JavaScript объект. Как бы вы представили данного пользователя ? Какие "параметры/ключи/свойства", должен данный объект по вашему мнению содержать ?

  • Строку
@OlegLustenko
OlegLustenko / draft.md
Created April 25, 2017 14:01 — forked from mpj/draft.md
Feedback for episode draft: 7 critical traits for a normal programmer

7 critical traits for a normal programmer

EARLY DRAFT FOR NEXT EPISODE, PLEASE PROVIDE FEEDBACK

This week I tweeted and tooted this question:

”What do you think are critical traits in a programmer? NOT to be super 10x or anything - just to feel good and function well professionally.”

Link to full threads here: [https://twitter.com/mpjme/status/855691565460848640]