Skip to content

Instantly share code, notes, and snippets.

@joakin
joakin / kill-process-bound-to-port.sh
Created June 12, 2025 11:23
Killing a process that is bound to a port, to free it
# Find the process using the port (replace 3000 with your port)
lsof -ti:3000 | xargs kill -9
Or step by step:
# Find what's using the port
lsof -i:3000
# Kill by PID (replace 1234 with actual PID)
kill -9 1234
@joakin
joakin / Perfect PPL.md
Created March 12, 2025 12:58
Perfect PPL - Athlean X

PERFECT PPL WORKOUT - PUSH 1

  1. Barbell Bench Press - 4 x 4-6 (leave 1-2 reps in the tank)
  2. Hi-to-Low Crossovers - 3 x 10-12
  3. DB Shoulder Press - 4 x 8-10
  4. 1 1/2 Side Lateral Raises - 3 x 12-15
  5. Lying Tricep Extensions - 3 x 10-12 ⟶ DB Waiter's Curls - 3 x 10-12
  6. Rotator Cuff External Rotation - 3 x 15-20

PERFECT PPL WORKOUT - PULL 1

@joakin
joakin / mixed-list.html
Created December 11, 2024 11:10
HTML mixed item lists (paragraph, bullet, ordered, checklist)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Custom List Items</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Inter', sans-serif;
line-height: 1.6;
@joakin
joakin / nil.odin
Created August 7, 2023 22:57
Odin confusion with nil
package main
import "core:fmt"
Test :: struct {
test: int
}
EnumTest :: enum {
Int,
@joakin
joakin / watch-compile.sh
Last active July 25, 2023 11:20
Watch and compile elm files
#!/usr/bin/env bash
COLOR_OFF="\e[0m";
DIM="\e[2m";
function compile {
# Customize the elm make command as needed
elm make src/elm/Main.elm src/elm/Stories/**/*.elm && rm elm.js
}
@joakin
joakin / DebugJson.elm
Created January 26, 2023 16:19
Debug Json decoders helpers
log : String -> Json.Decode.Decoder a -> Json.Decode.Decoder a
log message =
Json.Decode.map (Debug.log message)
debug : String -> Json.Decode.Decoder a -> Json.Decode.Decoder a
debug message decoder =
Json.Decode.value
|> Json.Decode.andThen (debugHelper message decoder)
@joakin
joakin / ElmBenchmarks.elm
Created January 2, 2023 18:11
Elm benchmarking the best way to encode things to JSON and a few other things
module Main exposing (suite)
import Array exposing (Array)
import Benchmark as B exposing (..)
import Benchmark.Runner exposing (..)
import Dict
import Json.Encode as E
object =
@joakin
joakin / MaybeUnwrap.elm
Created December 20, 2021 07:39
Un safely unwrap a Maybe in production
unwrap : Maybe a -> a
unwrap maybeA =
case maybeA of
Just a ->
a
Nothing ->
unwrap maybeA
@joakin
joakin / countdown.js
Created May 22, 2021 18:12
Countdown minutes and write them to a file, useful for OBS or other programs that want to read files.
let fs = require("fs");
let [, , time] = process.argv;
if (!time) throw new Error("Define a countdown in minutes");
let minutes = Number(time);
if (!minutes || minutes <= 0)
throw new Error(`${time} parsed as ${minutes} which is not a valid time");`);
@joakin
joakin / .gitmodules
Last active October 26, 2021 07:41
Custom webgl-playground program type that handles touch events
[submodule "vendor/webgl-playground"]
path = vendor/webgl-playground
url = https://github.com/justgook/webgl-playground.git