Skip to content

Instantly share code, notes, and snippets.

Boris Okunskiy inca

Block or report user

Report or block inca

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
inca /
Created Jul 29, 2019
HexRay Laser Puzzle Privacy Policy

Privacy Policy

HexRay Laser Puzzle game is a Freemium app (Service) provided by Boris Okunskiy (Author) at no cost and is intended for use as is. It is designed for general audience, including children younger than 13 years old.

This page is used to inform the users of Service regarding our policies with the collection, use, and disclosure of Personal Information if anyone decided to use our Service.

If you choose to use our Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that we collect is used for providing and improving the Service. We will not use or share your information with anyone except as described in this Privacy Policy.

Information Collection and Use

inca / generate-combinations.js
Last active Jun 17, 2019
Generate Combinations Without Repetition
View generate-combinations.js
function* generateCombinations(array) {
if (array.length == 0) {
const head = array[0];
const tail = array.slice(1);
yield [head];
for (const comb of generateCombinations(tail)) {
yield comb;
yield [head].concat(comb);
View promise-reduce.es6
const tasks = [
function doAllTasks() {
return tasks.reduce((flow, task) => flow.then(() => task()),
View promise-all.es6
function doBunchOfStuff() {
return Promise.all([
.then([ thisResult, thatResult] => {
/* ... */
View promise-sequence.es6
function doSomeWork() {
return Promise.resolve()
.then(() => doSomething())
.then(() => doSomethingElse());
function doSomething() {
return new Promise(resolve => { /* ... */ });
View promise-to-callback.es6
function (done) {
.then(result => done(null, result), done);
View callback-to-promise.es6
// Most trivial one: promisified setTimeout
function timeout(delay) {
return new Promise(resolve => setTimeout(resolve, delay));
// Promisified request
import request from 'request';
function req(...args) {
return new Promise(resolve => {
inca /
Last active Jul 19, 2016
Stylesheets Styleguide

Minimal conventions for composing stylesheets — our response to CSS frameworks 🤓


Good classnames:

  • .myComponent
  • .myComponent-subComponent
  • .myComponent--modifier
inca /
Last active Nov 15, 2018
Koa 2 Router

Simple DIY router for Koa 2

Why? Because koa-route is too verbose and accepts middleware functions with weird signatures (e.g. async (ctx, param1, param2, next)) which prevent robust middleware composition. And koa-router has .use method that behaves not as Express users would expect.

This gist is not a library material (at least not yet), b/c it doesn't account for all possible use-cases for routers, since people tend to use them completely differently. Instead, it provides you with ~100sloc router which you can use and further adapt to your specific needs.


npm i --save koa@2 path-to-regexp methods koa-mount@next
inca /
Last active Aug 29, 2015
Browserify + Transforms + Symlinks

Browserify + Transforms + Symlinks

This document briefly describes how I tend to build static front-end apps with Browserify. Specifically, it addresses the "Avoiding ../../../../../" issue described in Browserify Handbook while also preserving the ability to use Browserify transforms.

The Heartbeat Problem

Requiring own modules using relative paths can quickly become pretty annoying:

var Users = require('../../../repository/users')
You can’t perform that action at this time.