Skip to content

Instantly share code, notes, and snippets.

View amilajack's full-sized avatar
🔨
Building @trypalette (hiring!)

Amila Welihinda amilajack

🔨
Building @trypalette (hiring!)
View GitHub Profile
@amilajack
amilajack / css-supports.js
Created January 29, 2017 03:36 — forked from codler/css-supports.js
CSS.supports() Polyfill
/*! CSS.supports() Polyfill
* https://gist.github.com/codler/03a0995195aa2859465f
* Copyright (c) 2014 Han Lin Yap http://yap.nu; MIT license */
if (!('CSS' in window)) {
window.CSS = {};
}
if (!('supports' in window.CSS)) {
window.CSS._cacheSupports = {};
window.CSS.supports = function(propertyName, value) {
@amilajack
amilajack / post-merge
Created January 23, 2017 21:49 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@amilajack
amilajack / what-forces-layout.md
Created December 29, 2016 02:10 — 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()
@amilajack
amilajack / esnextbin.md
Created December 2, 2016 23:56
esnextbin sketch
@amilajack
amilajack / esnextbin.md
Created November 1, 2016 23:51
esnextbin sketch
@amilajack
amilajack / esnextbin.md
Last active October 28, 2016 21:58
esnextbin sketch
@amilajack
amilajack / esnextbin.md
Created June 26, 2016 03:36
esnextbin sketch
@amilajack
amilajack / esnextbin.md
Created June 13, 2016 18:14
esnextbin sketch
@amilajack
amilajack / esnextbin.md
Created June 12, 2016 23:57
esnextbin sketch
@amilajack
amilajack / esnextbin.md
Created June 12, 2016 23:21
esnextbin sketch