Skip to content

Instantly share code, notes, and snippets.

View ShanikaEdiriweera's full-sized avatar
🏠
Working from home

Shanika Ediriweera ShanikaEdiriweera

🏠
Working from home
  • Melbourne, Victoria, Australia
View GitHub Profile
@rponte
rponte / CAP-Theorem
Created December 2, 2010 16:03
CAP - Consistency, Availability and Partition-Tolerant
CAP - Consistency, Availability and Partition-Tolerant
The CAP principle states that in distributed computing when it comes
to consistency (C), availability (A) and partition (P)
resilience/tolerance you can have only two of the three.
I was recently introduced to this principle and find it rather
insightful. Basically you can't have your cake and eat it too,
otherwise (computing) life would be too easy.
@jboner
jboner / latency.txt
Last active April 19, 2024 23:08
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
@ozh
ozh / new empty git branch.md
Last active March 3, 2024 13:42
Create a new empty branch in Git
$ git checkout --orphan NEWBRANCH
$ git rm -rf .

--orphan creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.

You can then start adding files and commit them and they will live in their own branch. If you take a look at the log, you will see that it is isolated from the original log.

@subodhkarwa
subodhkarwa / The Technical Interview Cheat Sheet.md
Created September 2, 2016 09:09 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.