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 / .gitignore
Created April 26, 2023 08:39 — forked from nicosingh/.gitignore
ECS using Terraform sample
*.tfbackup
.terraform/
*.tfstate
.terraform.tfstate.lock.info
@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 / git_cheat-sheet.md
Created April 15, 2020 19:40 — forked from davfre/git_cheat-sheet.md
git commandline cheat-sheet
@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 / esnextbin.md
Last active January 26, 2019 19:59
esnextbin sketch
@amilajack
amilajack / esnextbin.md
Created January 23, 2019 18:56
esnextbin sketch
@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 / fft-math127.js
Created May 14, 2018 18:31
FFT MATH 127
console.clear()
const l = 1;
const j = 1;
const m = 2;
const k = 2;
const d = 2;
const expression = []
@amilajack
amilajack / coordinating-async-react.md
Created September 19, 2017 02:07 — forked from acdlite/coordinating-async-react.md
Demo: Coordinating async React with non-React views

Demo: Coordinating async React with non-React views

tl;dr I built a demo illustrating what it might look like to add async rendering to Facebook's commenting interface, while ensuring it appears on the screen simultaneous to the server-rendered story.

A key benefit of async rendering is that large updates don't block the main thread; instead, the work is spread out and performed during idle periods using cooperative scheduling.

But once you make something async, you introduce the possibility that things may appear on the screen at separate times. Especially when you're dealing with multiple UI frameworks, as is often the case at Facebook.

How do we solve this with React?

@amilajack
amilajack / esnextbin.md
Created June 15, 2017 23:11
esnextbin sketch