- Rule of Modularity: Write simple parts connected by clean interfaces.
- Rule of Clarity: Clarity is better than cleverness.
- Rule of Composition: Design programs to be connected to other programs.
- Rule of Separation: Separate policy from mechanism; separate interfaces from engines.
- Rule of Simplicity: Design for simplicity; add complexity only where you must.
- Rule of Parsimony: Write a big program only when it is clear by demonstration that nothing else will do.
- Rule of Transparency: Design for visibility to make inspection and debugging easier.
- Rule of Robustness: Robustness is the child of transparency and simplicity.
- Rule of Representation: Fold knowledge into data so program logic can be stupid and robust.
- Rule of Least Surprise: In interface design, always do the least surprising thing.
| 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 |
| $ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj | |
| Cloning into 'my-awesome-proj'... | |
| ssh: connect to host github.com port 22: Connection timed out | |
| fatal: Could not read from remote repository. | |
| $ # This should also timeout | |
| $ ssh -T git@github.com | |
| ssh: connect to host github.com port 22: Connection timed out | |
| $ # but this might work |
| #!/usr/bin/env bash | |
| NAME=talisman.sh | |
| VERSION=1.1.0 | |
| SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | |
| TALISMAN_REPORT_VERSION="${TALISMAN_REPORT_VERSION:-1.4}" | |
| TALISMAN_INSTALL_SCRIPT="$HOME/install-talisman.sh" | |
| TALISMAN_HTML_REPORT="$HOME/.talisman/talisman_html_report" | |
| check_deps() { | |
| if [ -f "$TALISMAN_INSTALL_SCRIPT" ]; then |
| #### first class expresssion | |
| variable "ami" {} | |
| resource "aws_instance" "example" { | |
| ami = var.ami | |
| } | |
| #### list & map | |
| resource "aws_instance" "example" { | |
| vpc_security_group_ids = var.security_group_id != "" ? [var.security_group_id] : [] | |
| } |
You can't tell where a program is going to spend its time. Bottlenecks occur in surprising places, so don't try to second guess and put in a speed hack until you've proven that's where the bottleneck is.
Measure. Don't tune for speed until you've measured, and even then don't unless one part of the code overwhelms the rest.
Fancy algorithms are slow when n is small, and n is usually small. Fancy algorithms have big constants. Until you know that n is frequently going to be big, don't get fancy. (Even if n does get big, use Rule 2 first.)
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.
All other files should be in your own global gitignore file:
- Create a file called
.gitignorein your home directory and add any filepath patterns you want to ignore. - Tell git where your global gitignore file is.
Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute
.config/git/ignorefor.gitignorein your home directory, if you prefer.
| # syscalls | |
| https://www.youtube.com/watch?v=8g-NUUmCeGI | |
| # AppArmor, SELinux Introduction | |
| https://www.youtube.com/watch?v=JFjXvIwAeVI | |
| # Container Runtime Landscape | |
| https://www.youtube.com/watch?v=RyXL1zOa8Bw | |
| # Gvisor |