Skip to content

Instantly share code, notes, and snippets.

View adamaucamp's full-sized avatar
👀
Focusing

Adam adamaucamp

👀
Focusing
  • 18:32 (UTC +02:00)
View GitHub Profile
@adamaucamp
adamaucamp / gitcheats.txt
Created October 13, 2020 17:57 — forked from chrismccoy/gitcheats.txt
git cheats
# shortform git commands
alias g='git'
# push all branches to all remotes
git remote | xargs -L1 git push --all
# count lines of .js code in a repo
git ls-files | grep \\.js$ | xargs wc -l
# pretty tab'd git log
@adamaucamp
adamaucamp / 0-TLDR.md
Created October 11, 2020 21:17 — forked from RichardBronosky/0-TLDR.md
How to easily launch a temporary one-off git server from any local repository, to enable a peer-to-peer git workflow.

User 1

remote_server=172.31.0.1
git daemon --verbose --export-all --base-path=.git --reuseaddr --strict-paths .git/ > /tmp/git-serve.log 2>&1 &
ssh -R 9418:localhost:9418 ec2-user@$remote_server
git clone git://localhost/ local-repo-name

Repo from workstation is cloned onto server.

User 2

@adamaucamp
adamaucamp / bash-cheatsheet.sh
Created October 11, 2020 20:37 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@adamaucamp
adamaucamp / AdvancedDistributedSystemDesignCourseNotes.md
Created October 11, 2020 20:06 — forked from craigtp/AdvancedDistributedSystemDesignCourseNotes.md
Notes on Udi Dahan's Advanced Distributed System Design Course

Advanced Distributed System Design Course - Udi Dahan

Notes by Craig Phillips

Fallacies of Distributed Computing

  • There are 11 fallacies of Distributed Computing:
    1. The network is reliable
    2. Latency isn’t a problem
    3. Bandwidth isn’t a problem
    4. The network is secure
  1. The topology won’t change
@adamaucamp
adamaucamp / latency.txt
Created October 11, 2020 19:51 — forked from jboner/latency.txt
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
@adamaucamp
adamaucamp / clean_code.md
Created October 11, 2020 19:46 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules