Skip to content

Instantly share code, notes, and snippets.

View breadthe's full-sized avatar


View GitHub Profile
breadthe / Release golang apps using Github
Created February 7, 2024 07:00 — forked from danawoodman/Release golang apps using Github
Create a Go app release for every git version tag using Github Actions

Release golang apps using Github Actions

Want to release a new binary on Github for every new git tag (e.g. v1.2.7)? Here is a simple Github Actions yaml config file that should get you started.

This script will automatically checkout your code, setup the correct version of go as defined in your go.mod file and build your go binary (in this case using a Makefile default target), then upload it to a new Github Release.

# .github/workflows/release.yml
name: Build and release Go Project
breadthe / seismic-v1.2.0-update.json
Last active March 6, 2023 21:32
Seismic v1.2.0 update
"version": "1.2.0",
"notes": "Features: tsunami warning, open events on, Windows & Linux builds.",
"pub_date": "2023-03-03T03:43:39.322Z",
"platforms": {
"darwin-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVTRGQ4NVZVdDdlRnZvdGFIelZQbW9qcTRyd3B3Vis4Q1YwOUNjYWl4U2JGTzBWNWpRaXR6MndBanFhL2w3dysxbXRZcmV2aFhvTklNd3EwOUR4YXEvRjVuQncrZEMvaXdrPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjc3ODA3NzU5CWZpbGU6c2Vpc21pYy5hcHAudGFyLmd6CmpNZXJ0ZUdXckNadm1kdU5yRUZkRWZKWFdSRTh1S1RmNFcvUElQQnVFbFc4M1FrUWpsaHpUNGtKdk1oSWJ5NENlendGNmxMNEFWTVRmVUlmMzJYQUNRPT0K",
"url": ""
"darwin-aarch64": {
breadthe / seismic-update.json
Last active February 14, 2023 08:34
Seismic update.json
"version": "1.0.2",
"notes": "1.0.2 update",
"pub_date": "2023-02-13T21:42:04.140Z",
"platforms": {
"darwin-x86_64": {
"signature": "",
"url": ""
"darwin-aarch64": {
breadthe / Bytes.php
Created January 10, 2023 16:34 — forked from inxilpro/Bytes.php
namespace App\Support;
use InvalidArgumentException;
class Bytes
// Most modern systems use base-1000 rather than base-1024 for file size now
protected const BASE = 1000;
breadthe /
Last active July 29, 2023 20:00
Save image generation parameters into textfile along with the generated image + disable safety check
import argparse, os, sys, glob
import cv2
import torch
import numpy as np
from omegaconf import OmegaConf
from PIL import Image
from tqdm import tqdm, trange
from imwatermark import WatermarkEncoder
from itertools import islice
from einops import rearrange
breadthe /
Created September 2, 2022 17:56
Stable Diffusion prompt script
echo -n "Enter a prompt: "
read prompt
echo -n "Steps (default 10): "
read steps
if [[ -z "$steps" ]]; then
breadthe / app.js
Last active April 11, 2022 12:58
Alpine.js + Blade copy to clipboard button
Put this code at the bottom of `app.js`
Put it in a `clipboard.js` file and import it in `app.js` with:
window.initClipboard = () => {
breadthe / Log.php
Created April 2, 2022 21:56
Barebones PHP error logging class
// src/Log.php
namespace App;
* Barebones error logging class
* Location: <project root>/src/Log.php
* Usage:
breadthe / formatBytes.php
Created November 25, 2021 18:14
Format bytes to human readable (KB/MB/GB)
* Put this in bootstrap/helpers.php
* Add "files" key in composer.json > autoload: "files": ["bootstrap/helpers.php"]
* @see
function formatBytes(int $bytes, $precision = 2)
$units = ['B', 'KB', 'MB', 'GB', 'TB'];
breadthe / version.blade.php
Last active December 28, 2022 10:31
Display app git tag & commit hash in a Laravel app
// resources/views/app/version.blade.php
<span>{{ config('version.string') }}</span>
<span>{{ config('app.env') }}</span>
<span>{{ 'Laravel ' . app()->version() }}</span>
<span>{{ app()->getLocale() }}</span>