Skip to content

Instantly share code, notes, and snippets.

View ekazakov's full-sized avatar

Evgenii Kazakov ekazakov

  • Berlin
  • 06:27 (UTC -12:00)
View GitHub Profile
const isThenable = value => typeof value?.then === "function";
const wrapHandler = (handler, resolve, reject) => resultOrError => {
try {
const handledResult = handler(resultOrError);
if (isThenable(handledResult)) {
handledResult.then(resolve, reject);
} else {
resolve(handledResult);
@obenjiro
obenjiro / tracemeplz.md
Created April 17, 2021 05:18
Tracing.. what?

COMING SOON...

@tannerlinsley
tannerlinsley / README.md
Last active February 19, 2022 09:45
How to fix the multiple-instances of React error when using linked NPM modules that import React as a peer dependency

How to fix the multiple-instances of React error when using linked NPM modules that import React as a peer dependency

Back-link your linked module's React dependency back to your application's React

In your app that you are receiving the multiple-version error:

  • Go to node_modules/react
  • Run yarn link

In your linked module that also uses React:

  • Run yarn link react
@faceyspacey
faceyspacey / respond-framework-walkthrough.md
Last active April 25, 2019 13:03
Respond Framework Walkthrough

Respond Framework Walkthrough

Respond Framework is what happens if you build Redux & first-class concerns for routing into React, plus take a page from the traditional server-side MVC playbook when it comes to side-effects.

Here's a quick overview of the features and usage in Respond Framework.

Installation

@novemberborn
novemberborn / setup.md
Created January 7, 2016 15:05
OS X Redirect ports 80 and 443 to 8080 and 8443 respectively

Changes with .dev domains in mind.

Create /etc/pf.anchors/dev, containing:

rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443

@paulirish
paulirish / what-forces-layout.md
Last active July 5, 2024 08:26
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@RnbWd
RnbWd / build.js
Last active September 7, 2016 16:28
watchify-gulpify
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var config = require('../config.json');
var bundler = require('./bundler');
process.env.APP_ID = config.Client.AppId;
process.env.JS_KEY = config.Client.jsKey;
gulp.task('scripts', function() {
gulp.src('./src/js/init.js', {read: false})
@bomberstudios
bomberstudios / sketch-plugins.md
Last active February 26, 2024 07:02
A list of Sketch plugins hosted at GitHub, in no particular order.
#!/bin/sh
#
# Adam Sharp
# Aug 21, 2013
#
# Usage: Add it to your PATH and `git remove-submodule path/to/submodule`.
#
# Does the inverse of `git submodule add`:
# 1) `deinit` the submodule
# 2) Remove the submodule from the index and working directory