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 March 27, 2024 12:40
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 March 28, 2024 09:10
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.
@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:
@gosuri
gosuri / akash-inlets.md
Last active December 8, 2019 15:19
Using Inlets on Akash

Thanks to awesome @alexellis for this contribution:

  1. Set an Inlets Token
export INLETS_TOKEN=abcd1234
  1. Deploy Inlets on Akash using the below config: