Skip to content

Instantly share code, notes, and snippets.

View dleslie's full-sized avatar

Dan Leslie dleslie

View GitHub Profile
@feilen
feilen / stable.md
Created September 1, 2023 07:47
Using Stable Diffusion to add Albedo texture variation

Tiled textures are a fantastic way to spread a little memory around widely, but they often come with a rather noticable lack of variation.

Using this method you can add a lot of variation to a preexisting material, leveraging Stable Diffusion.

I'll be using this map:

image

Create a tiled map

@drewc
drewc / gist:5f260537b7914a2b999c8a539fb48098
Last active October 6, 2023 20:10
gerbil-swank for wiki?
━━━━━━━━━━━━━━━━━━━━━━━━━
I LOVE A SLIME'Y SWANK!
Drew Crampsie
━━━━━━━━━━━━━━━━━━━━━━━━━
Table of Contents
─────────────────
@joeheyming
joeheyming / breaktime.el
Last active August 25, 2015 23:18 — forked from camdez/breaktime.el
/u/joeheyming's Emacs break timer (modified)
;;; See: https://www.reddit.com/r/emacs/comments/3icpo7/take_a_break_every_3_hours/
(defvar breaktime-timer nil
"Holds the running break timer (if any).")
(defvar breaktime-wait "3 hours"
"How long to wait for the next break.")
(defun breaktime--set-next-breaktime ()
"If we kill a breaktime buffer, set another wait timeout"
(when (string= (buffer-name) "*breaktime*")
(setq breaktime-timer (run-at-time breaktime-wait nil 'breaktime--take-a-break))))
(defun override-theme (arg)
"Disables all enabled themes and then loads the provided theme."
(interactive
(list
(intern (completing-read "Load custom theme: "
(mapcar 'symbol-name (custom-available-themes))))))
(while custom-enabled-themes
(disable-theme (car custom-enabled-themes)))
(load-theme arg t))
@dleslie
dleslie / font-lock-keywords.el
Created February 25, 2012 22:29
Easy add/remove keywords from font lock
(defun add-font-lock-keywords (modes new-keywords)
(mapc (lambda (mode)
(font-lock-add-keywords mode `((, (concat "(\\(" (regexp-opt (mapcar 'symbol-name (remove-if 'numberp new-keywords)) t) "\\)\\>")
(1 font-lock-keyword-face)))))
modes)
t)
(defun remove-font-lock-keywords (modes new-keywords)
(mapc (lambda (mode)
(font-lock-remove-keywords mode `((, (concat "(\\(" (regexp-opt (mapcar 'symbol-name (remove-if 'numberp new-keywords)) t) "\\)\\>")
@dleslie
dleslie / getmp3
Created December 12, 2011 00:25
wget converter from flac to mp3
#!/bin/bash
for link in `cat list.txt`; do
fname=`echo $link | awk -F"/" '{print $5}'`
wget -c --limit-rate=500k $link -qO - | flac -cd - | lame -h - "$fname.mp3"
sleep 120
done