Skip to content

Instantly share code, notes, and snippets.

function sequentialCallback (...fns) {
return (...args) => {
const done = args.pop()
const next = (error, ...args) => {
if (error) return done(error)
if (fns.length) {
const fn = fns.shift()
return fn(...args, next)
}
return done(null, ...args)
@tingwei628
tingwei628 / Dockerfile
Created February 1, 2021 05:59 — forked from angeloskaltsikis/Dockerfile
A wrapper to make Terragrunt less verbose (both plan & apply supported). Also includes all the files required to efficiently run Terragrunt with Atlantis.
ARG atlantis_version=v0.15.0
FROM runatlantis/atlantis:${atlantis_version}
LABEL maintainer="Beat DevOps Team"
LABEL description="thebeat.co atlantis image used in IaC CI/CD!"
LABEL version="0.2"
# https://github.com/gruntwork-io/terragrunt/releases
ARG terragrunt_version=v0.25.1
@tingwei628
tingwei628 / update-git.sh
Created February 6, 2021 04:28 — forked from YuMS/update-git.sh
Update git to latest version on Ubuntu
#!/bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y
@tingwei628
tingwei628 / README.md
Created May 20, 2021 05:00 — forked from dims/README.md
Kubernetes Resources
@tingwei628
tingwei628 / resources.md
Created June 6, 2021 07:19 — forked from muff-in/resources.md
A curated list of Assembly Language / Reversing / Malware Analysis -resources
@tingwei628
tingwei628 / kernel-dev.md
Created June 23, 2021 10:39 — forked from vegard/kernel-dev.md
Getting started with Linux kernel development

Getting started with Linux kernel development

Prerequisites

The Linux kernel is written in C, so you should have at least a basic understanding of C before diving into kernel work. You don't need expert level C knowledge, since you can always pick some things up underway, but it certainly helps to know the language and to have written some userspace C programs already.

It will also help to be a Linux user. If you have never used Linux before, it's probably a good idea to download a distro and get comfortable with it before you start doing kernel work.

Lastly, knowing git is not actually required, but can really help you (since you can dig through changelogs and search for information you'll need). At a minimum you should probably be able to clone the git repository to a local directory.

@tingwei628
tingwei628 / latency.txt
Created July 13, 2021 14:35 — 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
@tingwei628
tingwei628 / 1_simple.go
Created April 18, 2022 19:00 — forked from sosedoff/1_simple.go
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"