Skip to content

Instantly share code, notes, and snippets.

@soniah
soniah / goimports2.sh
Created August 30, 2019 05:37
remove all blank lines in go 'imports' statements
#!/bin/bash
# remove all blank lines in go 'imports' statements,
# then sort with goimports
if [ $# != 1 ] ; then
echo "usage: $0 <filename>"
exit 1
fi
@mmailhos
mmailhos / AWS Architect Associate - Reminder.md
Last active December 3, 2021 21:50
AWS Architect Associate - Reminder

AWS Architect Associate - Reminder

A few notes for passing the AWS Architect Associate certification - March 2018

EC2

General purpose SSD have a maximum of 10.000 IOPS.

It is possible to detach non-root volume from running EC2 instance.

@supermarin
supermarin / .env
Last active April 2, 2024 13:57
Colored `man` pages on OSX
# ZSH / BASH users
# Add this to your .env, .bashrc, .zshrc, or whatever file you're using for environment
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
@rjattrill
rjattrill / multiline-values.yaml
Created November 18, 2013 06:33
Break YAML over multiple lines
# Join multiple lines without new line
value: >
part 1
part 2
# Join with newline
value2: |
line 1
line 2
@jboner
jboner / latency.txt
Last active July 17, 2024 03:12
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