Skip to content

Instantly share code, notes, and snippets.

View okonet's full-sized avatar

Andrey Okonetchnikov okonet

View GitHub Profile
@okonet
okonet / ScrollPane.js
Created January 13, 2017 18:17
React at 60fps Example 2
handleScroll = (evt) => {
// Calculate new scrollTop positions
// for left and right panes based on
// DOM nodes and evt.target.scrollTop
this.leftPaneScrollTop = …
this.rightPaneScrollTop = …
}
@okonet
okonet / ScrollPane.js
Last active January 16, 2017 10:52
React at 60fps Example 1
class ScrollPane extends React.Component {
componentDidUpdate() {
// Each time we get new props we set the
// new scrollTop position on the DOM element
this.el.scrollTop = this.props.scrollTop
}
render() {
<div ref={(el) => {this.el = el}}>
}
}
@okonet
okonet / package.json
Created November 20, 2016 18:48
Automatic yarn updates as a post-checkout hook
{
"devDependencies": {
"ghooks": "^1.3.2"
},
"config": {
"ghooks": {
"post-checkout": "./script/yarn-update.hook.sh $2 $3"
}
}
}
@okonet
okonet / esnextbin.md
Last active August 4, 2016 13:13
esnextbin sketch
@okonet
okonet / .gitconfig
Created July 31, 2016 07:56
My Git Config
[core]
excludesfile = ~/.gitignore
autocrlf = false
pager = diff-so-fancy | less --tabs=4 -RFX
[alias]
st = status -sb
ci = commit
co = checkout
br = branch
df = diff --word-diff
@okonet
okonet / esnextbin.md
Created July 6, 2016 07:55
esnextbin sketch
@okonet
okonet / esnextbin.md
Created July 6, 2016 07:53
esnextbin sketch
@okonet
okonet / esnextbin.md
Last active July 6, 2016 07:54
esnextbin sketch
@okonet
okonet / test.jsx
Last active January 8, 2016 22:15
What's more _readable_ in your opinion?
<Card>
<h4 className="TaskListItem_title">
<span className="TaskListItem_icon-type">
<Icon name={iconMap[type]}/>
</span>
{title} <span className="TaskListItem_id">#{id}</span>
</h4>
<div className="TaskListItem_stats">
<p className="TaskListItem_stat-item"><Icon name="code-fork"/> {commits}</p>
> webpack
Hash: 92670583f688a262fdad
Version: webpack 1.10.1
Time: 65ms
Asset Size Chunks Chunk Names
chunk-manifest.json 68 bytes [emitted]
vendor.6d107863983028982ef4.js 3.71 kB 0 [emitted] vendor
1.c4116058de00860e5aa8.js 107 bytes 1 [emitted]