Skip to content

Instantly share code, notes, and snippets.

@mnlwldr
mnlwldr / goup.sh
Created March 14, 2024 15:56
Update go to the latest version
#!/bin/sh
RELEASE=$(/usr/local/bin/go list -m -f '{{.Version}}' go@latest)
GO_FILE=go${RELEASE}.linux-amd64.tar.gz
BIN=https://go.dev/dl/${GO_FILE}
echo "download $GO_FILE from $BIN ..."
@mitchellh
mitchellh / merge_vs_rebase_vs_squash.md
Last active April 22, 2024 16:22
Merge vs. Rebase vs. Squash

I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.

I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:

@veekaybee
veekaybee / normcore-llm.md
Last active April 23, 2024 16:03
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@timlinux
timlinux / creating_3d_models_for_QGIS_with_ODM.md
Last active May 7, 2023 11:05
Creating 3D Models for QGIS With ODM

Capture a movie on your phone of the object by walking around it. If possible shoot it from different angles e.g. from above looking down, below looking up, side on etc. When you film it, walk around it or move the camera around it in a full 360 revolution (or even a couple of revolutions). You should get something like this (note that the image below is a resized copy of the orignal downrated to 1 fps):

DrinkingFountainSmall

Put the video into an empty folder and then use ffmpeg to extract the frames. You can experiment with different frame rates but generally there will be little value in extracting at 60fps or whatever your phone natively shoots at.

If you are on an iPhone you may need to convert your movie from .HEIC format first:

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ityonemo
ityonemo / test.md
Last active April 25, 2024 10:23
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@dragonsinth
dragonsinth / gcp-kube.go
Last active February 14, 2024 10:14
Connect to Google Kubernetes with GCP credentials and pure Golang
package main
import (
"context"
"encoding/base64"
"flag"
"fmt"
"log"
"google.golang.org/api/container/v1"
@a1ip
a1ip / hostname.md
Last active March 18, 2024 00:01
How to set the Mac hostname or computer name from the terminal

How to set the Mac hostname or computer name from the terminal

  1. Open a terminal.
  2. Type the following command to change the primary hostname of your Mac: This is your fully qualified hostname, for example myMac.domain.com
sudo scutil --set HostName <new host name>
  1. Type the following command to change the Bonjour hostname of your Mac: This is the name usable on the local network, for example myMac.local.
// Create a Worker we want to share memory with:
let w = new Worker(`data:text/javascript,
onmessage = ({data: memory}) => {
// Got WebAssembly.Memory once, log same instance forever with no further postMessages:
setInterval(() => console.log('Current buffer in worker:', memory.buffer), 5_000);
}
`);
// Create a shared growable memory:
let m = new WebAssembly.Memory({ initial:1, maximum: 65536, shared: true });
// Send memory to the worker: