Skip to content

Instantly share code, notes, and snippets.

View earthbound19's full-sized avatar
๐Ÿš€
creative coding, aiming for Art Blocks

Alex Hall earthbound19

๐Ÿš€
creative coding, aiming for Art Blocks
View GitHub Profile
@eggbean
eggbean / windirstat-add-context-menu.ps1
Last active April 1, 2026 02:27
WinDirStat PowerShell script or registry file to add context menu entries to open on drives or folder, with a little icon. No longer needed with WinDirStat v2.
# Adds shell integration for WinDirStat. The program should be installed in
# Program Files (x86) but it will check if that directory is not on C:
#
# Alternatively, if installed on C: you can use the reg file below instead.
if (-not ([security.principal.windowsprincipal][security.principal.windowsidentity]::getcurrent()).isinrole([security.principal.windowsbuiltinrole]::administrator)) {
write-error "this script needs to be run as an administrator. please restart powershell as an administrator and try again."
exit
}
@dfaker
dfaker / alternate_sampler_noise_schedules.py
Last active April 3, 2024 09:16
Alternate sampler noise schedules for stable-diffusion-webui
import inspect
from modules.processing import Processed, process_images
import gradio as gr
import modules.scripts as scripts
import k_diffusion.sampling
import torch
class Script(scripts.Script):
@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");
@trygvebw
trygvebw / find_noise.py
Last active December 13, 2025 14:53
A "reverse" version of the k_euler sampler for Stable Diffusion, which finds the noise that will reconstruct the supplied image
import torch
import numpy as np
import k_diffusion as K
from PIL import Image
from torch import autocast
from einops import rearrange, repeat
def pil_img_to_torch(pil_img, half=False):
image = np.array(pil_img).astype(np.float32) / 255.0
@pouyakary
pouyakary / A much much better import for ECMAScript.md
Last active March 18, 2026 20:58
A much much better import for ECMAScript

So if you have ever written in a ECMAScript language (JavaScript/TypeScript/...) you know that the autocomplete on the import is crap. Since you first say what you want and then say where from so the autocomplete has no idea what is available:

Visual Studio Code lets you define where in the snippets you want to fill step by step and that became a really good way to fix the problem. With the imp snippet you can do:

Note: this content is reposted from my old Google Plus blog, which disappeared when Google took Plus down. It was originally published on 2016-05-18. My views and the way I express them may have evolved in the meantime. If you like this gist, though, take a look at Leprechauns of Software Engineering. (I have edited minor parts of this post for accuracy after having a few mistakes pointed out in the comments.)

Degrees of intellectual dishonesty

In the previous post, I said something along the lines of wanting to crawl into a hole when I encounter bullshit masquerading as empirical support for a claim, such as "defects cost more to fix the later you fix them".

It's a fair question to wonder why I should feel shame for my profession. It's a fair question who I feel ashamed for. So let's drill a little deeper, and dig into cases.

Before we do that, a disclaimer: I am not in the habit of judging people. In what follows, I only mean to condemn behaviours. Also, I gath

@mattdesl
mattdesl / README.md
Last active November 18, 2021 13:14
seedable PRNG from hash
@rdixon22
rdixon22 / artblocks_page_template.html
Last active March 14, 2021 04:14
Here's a simple web page template to use for testing an artblocks.io project. It generates a random hash and token ID each time the page reloads. It assumes a p5.js project (pulling that from a CDN to limit dependencies). Your project code goes in myproject.js.
<!DOCTYPE html>
<html lang="en">
<head>
<script>
// Generates a random hash and token id each time you reload, in the following format
//let tokenData = {"hash":"0xd9134c11cd5ed9798ea0811364d63bd850c69c5d13383c9983ade39847e9ea86","tokenId":"99000000"};
function genTokenData(projectNum)
{
let data = {};
@rogerallen
rogerallen / 0_tweegeemee.txt
Last active August 21, 2021 16:06
tweegeemee archive 10/19/2019
Archive of the code for images posted to https://twitter.com/tweegeemee
Started October 19, 2019
:clisk-random-seed 191019
Learn more at https://github.com/rogerallen/tweegeemee
@tobias93
tobias93 / gist:3f9b516bc2e67eea1e0fa255cf99b824
Created October 28, 2016 12:29
Simple Slither.io bot
// ==UserScript==
// @name Slither Bot
// @namespace http://slither.io/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://slither.io/
// @grant none
// ==/UserScript==