Skip to content

Instantly share code, notes, and snippets.

View zainfathoni's full-sized avatar
:octocat:
Revamping www.zainfathoni.com

Zain Fathoni zainfathoni

:octocat:
Revamping www.zainfathoni.com
View GitHub Profile
@zainfathoni
zainfathoni / iterm2-solarized.md
Created November 9, 2019 12:15 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@zainfathoni
zainfathoni / WhyReact.md
Created October 26, 2019 03:00 — forked from sebmarkbage/WhyReact.md
Why is React doing this?

I heard some points of criticism to how React deals with reactivity and it's focus on "purity". It's interesting because there are really two approaches evolving. There's a mutable + change tracking approach and there's an immutability + referential equality testing approach. It's difficult to mix and match them when you build new features on top. So that's why React has been pushing a bit harder on immutability lately to be able to build on top of it. Both have various tradeoffs but others are doing good research in other areas, so we've decided to focus on this direction and see where it leads us.

I did want to address a few points that I didn't see get enough consideration around the tradeoffs. So here's a small brain dump.

"Compiled output results in smaller apps" - E.g. Svelte apps start smaller but the compiler output is 3-4x larger per component than the equivalent VDOM approach. This is mostly due to the code that is usually shared in the VDOM "VM" needs to be inlined into each component. The tr

@zainfathoni
zainfathoni / what-forces-layout.md
Created January 17, 2019 10:26 — 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()
@zainfathoni
zainfathoni / gpggithub.md
Created December 16, 2018 11:13 — forked from r17x/gpggithub.md
GPG Signing Key For Github
  • Setup Basic
$ git config --global user.name "name"
$ git config --global user.email "email"

# mac
$ brew install gpg
# brew install gpg2 

$ git config --global gpg.program gpg

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
@zainfathoni
zainfathoni / macosx_remove_java9.sh
Created February 21, 2018 08:39 — forked from schnell18/macosx_remove_java9.sh
MacOS X remove Java 9
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.jdk/
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
@zainfathoni
zainfathoni / gist:5559ff7db51af4c21259c177c62672c4
Created May 31, 2017 15:44 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@zainfathoni
zainfathoni / gist:a214f0df757a1d8ceff6d6402fa73c9b
Created April 8, 2017 09:33 — forked from abesto/gist:3476594
Go: Newton's method for square root
/*
A Tour of Go: page 44
http://tour.golang.org/#44
Exercise: Loops and Functions
As a simple way to play with functions and loops, implement the square root function using Newton's method.
In this case, Newton's method is to approximate Sqrt(x) by picking a starting point z and then repeating: z - (z*z - x) / (2 * z)
@zainfathoni
zainfathoni / Object.assign.js
Created November 8, 2016 22:27 — forked from fabien-d/Object.assign.js
Nested Object.assign calls formatting
let object = {
key: {
subkey: 'value',
status: 'STATUS'
}
};
// compact
Object.assign( {}, object, { key: Object.assign( {}, object.key, { status: 'PENDING' } ) } );
@zainfathoni
zainfathoni / .gitignore
Created December 23, 2015 10:12 — forked from mahdi/.gitignore
A .gitignore file for a .NET developer
#Junk Files
*.DS_Store
[Tt]humbs.db
#Visual Studio Files
[Oo]bj
[Bb]in
[Dd]ebug
[Bb]uild/
*.user