Skip to content

Instantly share code, notes, and snippets.

Oleg Isonen kof

Block or report user

Report or block kof

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
@sebmarkbage
sebmarkbage / The Rules.md
Last active Nov 15, 2019
The Rules of React
View The Rules.md

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

@okonet
okonet / lightning_talk_proposal.md
Last active Apr 10, 2018
Make linting great again! -- ReactiveConf 2017 ⚡️talk proposal
View lightning_talk_proposal.md

Please 🌟 this gist to vote for this proposal!

Make linting great again!

tabs vs spaces

No other topic in software development probably has so much controversy as linting.

With a wrong workflow linting can be really a pain and will slow you and your team down. With a proper setup, though, it can save you hours of manual work reformatting the code and reducing the code-review overhead.

@kitten
kitten / reactiveconf-sc-cfp.md
Last active Dec 17, 2018
ReactiveConf 2017 Lightning Talk CFP: With styled-components into the future
View reactiveconf-sc-cfp.md

styled-components Logo

With styled-components into the future

Preprocessing is dead, long live preprocessing!


This is a CFP for ReactiveConf 2017's open call for Lightning talks. If you'd like to see this talk become a reality, please ⭐️ star this gist. #ReactiveConf

@conorhastings
conorhastings / simple-redux.js
Last active Jun 29, 2019
A very (read: don't do this) simple implementation of redux
View simple-redux.js
/*
* The reason for this is just a thought exercise
* often people(myself super included) are so confused
* when trying something new, but breaking it down
* to it's simplest existence can be the best way to understand
*/
function createStore(reducer, initState) {
let state = initState;
let subscribers = [];
@nnarhinen
nnarhinen / app.js
Last active Dec 21, 2015
Automatically join sockets to user-specific rooms using express.js sessions and socket.io
View app.js
/**
* Module dependencies.
*/
var express = require('express'),
http = require('http'),
RedisStore = require('connect-redis')(express),
redis = require('redis'),
cookie = require('cookie'),
connect = require('connect'),
@KrofDrakula
KrofDrakula / raf.js
Last active Dec 15, 2015
Due to a bug in the native `requestAnimationFrame` function running inside `<iframe>` elements on iOS 6, I've decided to write up a custom function that implements a blacklist. Use this snippet and use `nextFrame` and `cancelFrame` on the `window` object to use this workaround with the same method signature as the spec. I've avoided overriding t…
View raf.js
// requestAnimationFrame implementation as a custom function to allow blacklisting
// devices with broken implementation. Currently needs timer-based fallbacks for iOS 6.x for
// code running inside <iframe> elements.
// Uses polyfills based on http://paulirish.com/2011/requestanimationframe-for-smart-animating/
(function() {
var blacklisted = /iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent),
lastTime = 0,
nativeRequest = window.requestAnimationFrame || null,
nativeCancel = window.cancelAnimationFrame || null;
@jonasfj
jonasfj / rAF.js
Last active Dec 10, 2015 — forked from paulirish/rAF.js
A list-based fallback implementation of `requestAnimationFrame` that reduces the number of `setTimeout`s needed.
View rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller
// fixes from Paul Irish and Tino Zijdel
// list-based fallback implementation by Jonas Finnemann Jensen
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@mloughran
mloughran / page.html
Created Mar 16, 2012
Mobile Safari crash when returning to WebSocket page
View page.html
<html>
<head>
<script>
function debug(string) {
var element = document.getElementById("debug");
var p = document.createElement("p");
p.appendChild(document.createTextNode(string));
element.appendChild(p);
}
@bebraw
bebraw / gameengines.md
Created Jan 6, 2011
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.
View gameengines.md

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out the [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]] and [[Scene Graphs]].

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n
You can’t perform that action at this time.