Skip to content

Instantly share code, notes, and snippets.

View janosorcsik's full-sized avatar

János Orcsik janosorcsik

View GitHub Profile
@jboner
jboner / latency.txt
Last active May 20, 2024 17:41
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@jonahoffline
jonahoffline / screenshots_iCloud.md
Created September 1, 2014 19:39
Save screenshots to iCloud Folder (OSX)

Change your default screenshots location (desktop)

defaults write com.apple.screencapture location folder_name_here

Example

Save screenshots to the 'Screenshots' folder (inside iCloud Drive)

defaults write com.apple.screencapture location ~/Library/Mobile\ Documents/com~apple~CloudDocs/Screenshots

@GavinJoyce
GavinJoyce / gist:4004b6ad7dda427e629f
Last active February 15, 2020 08:12
jQuery event leak detection
var walk_the_DOM = function walk(node, func) {
func(node);
node = node.firstChild;
while (node) {
walk(node, func);
node = node.nextSibling;
}
};
var totalSubscriptionCount = 0;
@gklka
gklka / safari_custom_stylesheet.css
Last active December 10, 2023 15:35
safari_custom_stylesheet.css
#hcdb {
display: none;
}
div.hird_120 {
display: none;
}
body.terkep {
padding-top: 0 !important;
@paulirish
paulirish / what-forces-layout.md
Last active May 20, 2024 17:15
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.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@parmentf
parmentf / GitCommitEmoji.md
Last active May 20, 2024 14:58
Git Commit message Emoji
# Add the remote, call it "upstream":
git remote add upstream https://github.com/whoever/whatever.git
# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:
git fetch upstream
# Make sure that you're on your master branch:
@Tyrael
Tyrael / active.md
Last active November 10, 2021 08:53
active github users from Hungary

Most active GitHub users from Hungary

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Sun, 30 Aug 2015 10:08:52 GMT till Tue, 30 Aug 2016 10:08:52 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user => user.followers > 1)

Demo

How to install

  1. Get fzf
  2. Install all-the-package-names globally: npm i -g all-the-package-names
  3. Add the following alias to your .bashrc: alias npmi = 'all-the-package-names | fzf | xargs npm install'

How to use

Just use npmi instead of npm i <package-name>. All options work (--save, -g etc).

@swyxio
swyxio / flexbox-cheat-sheet.md
Last active January 19, 2023 07:35
cheat sheet from flexbox.io