Skip to content

Instantly share code, notes, and snippets.

@kwannoel
kwannoel / Dockerfile
Created April 13, 2022 08:33
Ubuntu dockerfile
#Create ubuntu as base image
FROM ubuntu
#Install packages
RUN apt-get -y update
RUN apt-get -y install python3
RUN apt-get -y install gdb
RUN apt-get -y install gcc
@kwannoel
kwannoel / mutex.go
Created May 1, 2022 08:02
Mutex using channels and goroutines
import (
"fmt"
"sync"
)
type Mutex struct {
lockCh chan struct {}
unlockCh chan struct {}
doneCh chan struct {}
}
@kwannoel
kwannoel / and-hides-errors.sh
Created July 25, 2023 06:07
`./and-hides-errors.sh` then `echo $?` it should be 0.
#!/usr/bin/env bash
set -euo pipefail
throw_error() {
cat ahjwkbhw
}
throw_error && echo "1"