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 |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
Slack doesn't provide an easy way to extract custom emoji from a team. (Especially teams with thousands of custom emoji) This Gist walks you through a relatively simple approach to get your emoji out.
If you're an admin of your own team, you can get the list of emoji directly using this API: https://api.slack.com/methods/emoji.list. Once you have it, skip to Step 3
HOWEVER! This gist is intended for people who don't have admin access, nor access tokens for using that list.
Follow along...
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
#!/bin/sh | |
CASKNAME="$1" | |
CASKROOM=$(brew --caskroom) | |
CASKDIR="$CASKROOM/$CASKNAME" | |
DATE=$(date +"%Y%m%d%H%M%S.000") | |
BACKUPDIR="$CASKDIR/.backup" | |
BLACK='\033[30m' | |
RED='\033[31m' |
property AIRDROP_FOLDER : "Path:to:AirDrop:Folder:in:Alias:format" | |
property QUARANTINE_KEY : "59" | |
property GET_QUARANTINE_COMMAND_START : "ls -l -@ '" | |
property GET_QUARANTINE_COMMAND_END : "' | tr '\\n' ' ' | sed 's/.*com\\.apple\\.quarantine\\s*\\(\\d*\\)/ \\1/' | awk '{$1=$1};1'" | |
on adding folder items to this_folder after receiving added_items | |
repeat with i from 1 to length of added_items | |
set current_item to item i of added_items | |
set quarantine_type to getQuarantineType(POSIX path of current_item) |
Google Fonts suggests syncing fonts to your computer with a tool called SkyFonts. However, if you're running MacOS and want to keep your machine updated with all Google Fonts without any extra software, you can do this with Git, thanks to the Google Fonts Repo.
To do this, run the following in your terminal:
cd ~/Library/Fonts/
git clone --depth 1 https://github.com/google/fonts.git google-fonts
Done! In the future, you can download new fonts by running:
# Create a container from the mongo image, | |
# run is as a daemon (-d), expose the port 27017 (-p), | |
# set it to auto start (--restart) | |
# and with mongo authentication (--auth) | |
# Image used is https://hub.docker.com/_/mongo/ | |
docker pull mongo | |
docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth | |
# Using the mongo "localhost exception" (https://docs.mongodb.org/v3.0/core/security-users/#localhost-exception) | |
# add a root user |