Skip to content

Instantly share code, notes, and snippets.

View theJian's full-sized avatar
👾
Fighting space invaders

Tan Kian theJian

👾
Fighting space invaders
  • Anaemia Studios
  • The place where there is no darkness.
View GitHub Profile
@theJian
theJian / README.md
Created December 10, 2017 13:48 — forked from HenrikJoreteg/README.md
Minimalist routing in Redux

Why would you want to do this? Because you often don't need more. It's nice to not have to think about your "router" as this big special thing.

Instead, with this approch, your app's current pathname is just another piece of state, just like anything else.

This also means that when doing server-side rendering of a redux app, you can just do:

var app = require('your/redux/app')
var React = require('react')
@theJian
theJian / what-forces-layout.md
Created August 17, 2017 03:00 — forked from paulirish/what-forces-layout.md
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.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@theJian
theJian / ss-install.md
Created February 12, 2016 15:18 — forked from aa65535/ss-install.md
shadowsocks-libev install at Debian or CentOS

Debian

cd /tmp
# 下载源码
git clone https://github.com/madeye/shadowsocks-libev.git
# 开始编译
cd shadowsocks-libev
./autogen.sh
./configure --prefix=/usr && make
make install
@theJian
theJian / gist:e62426c0e33a0659f007
Last active September 15, 2015 01:26 — forked from technoweenie/gist:1072829
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
@theJian
theJian / 0_reuse_code.js
Last active August 30, 2015 18:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console