Skip to content

Instantly share code, notes, and snippets.

@mattdesl
mattdesl / cli.js
Created September 13, 2022 10:37
colour palette from text prompt using Stable Diffusion https://twitter.com/mattdesl/status/1569457645182152705
/**
* General-purpose NodeJS CLI/API wrapping the Stable-Diffusion python scripts.
*
* Note that this uses an older fork of stable-diffusion
* with the 'txt2img.py' script, and that script was modified to
* support the --outfile command.
*/
var { spawn, exec } = require("child_process");
var path = require("path");
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 15, 2024 20:11
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@adewes
adewes / README.md
Last active March 8, 2024 21:58
Borg Backup - Shell script to create regular backups (can e.g. be called hourly by cron).

Borg Backup Script

This is a little helper script to regulary back up your data using the Borg backup tool. I wrote this as I was frustrated with Deja-Dup, which does not allow me to exclude directories by pattern, hence I ended up with backups that were very large and took a really long time to create because they contained many directories with non-essential files (e.g. node modules or Python virtual environments). Borg backup is a simple tool that offers everything that Deja-Dup does and is easier to customize.

  • Put the script in your home folder and make it executable.
  • Call it regularly using e.g. cron (put e.g. "0 * * * * [your username] /home/[your username]/make_backup.sh" in your /etc/crontab - this will call the script every hour). Please note that the script will perform its own checking to see
@logrusorgru
logrusorgru / imgrsz.go
Created November 3, 2016 18:50
Golang resize png images using different interpolations
package main
import (
"image"
"image/png"
"log"
"os"
"time"
"golang.org/x/image/draw"
@mrrooijen
mrrooijen / README.md
Last active February 11, 2023 19:44
Setting up XEN on a Hetzner Dedicated Server

Setting up XEN on a Hetzner Dedicated Server

Author: Michael van Rooijen (@mrrooijen)

DISCLAIMER: I am a programmer, not a sysadmin in my day-to-day life. I provide this guide simply as a self-reference, and as a way to contribute to the community of developers. The main motivation for writing this guide is because of the lack of properly written guides/tutorials. They were either out-dated, inaccurate, in a non-English language or simply too vague to understand (at least for me, as a programmer and not a sysadmin).

I hope this guide helps getting you up and running with your own collection of VPS's on your own Dedicated Server over at Hetzner.de.

Requirements: