Skip to content

Instantly share code, notes, and snippets.

View mac641's full-sized avatar
🥁

Marcel mac641

🥁
View GitHub Profile
@kaaquist
kaaquist / podman_macos.md
Last active July 29, 2024 09:13
Podman with docker-compose on MacOS.

Podman with docker-compose on MacOS.

Podman an alternative to Docker Desktop on MacOS

Getting podman installed and started is super easy.
Just use brew to install it.

> brew install podman

Now since podman uses a VM just like the Docker Client on MacOS we need to initialize that and start it.

@jboursiquot
jboursiquot / limit_goroutines_with_semaphores.go
Last active October 6, 2023 15:56
Limiting the number of running goroutines using semaphores in #golang
var (
concurrency = 5
semaChan = make(chan struct{}, concurrency)
)
func doWork(item int) {
semaChan <- struct{}{} // block while full
go func() {
defer func() {
<-semaChan // read releases a slot
@soulik
soulik / os_name.lua
Created May 12, 2015 18:23
OS type and CPU architecture detection in Lua language
local function getOS()
local raw_os_name, raw_arch_name = '', ''
-- LuaJIT shortcut
if jit and jit.os and jit.arch then
raw_os_name = jit.os
raw_arch_name = jit.arch
else
-- is popen supported?
local popen_status, popen_result = pcall(io.popen, "")