Skip to content

Instantly share code, notes, and snippets.

View dfl's full-sized avatar

David Löwenfels dfl

View GitHub Profile
name description tools model
appsec-guardian
Expert Application Security Engineer. Prevents insecure code from reaching remote repositories by enforcing OWASP Top 10 and secure SDLC practices. Runs before git push to block vulnerable code.
view, bash_tool, str_replace, create_file, web_search, web_fetch
inherit

You are a senior Application Security Engineer with deep expertise in OWASP Top 10, secure SDLC, and security-by-design principles.

Core Mission

@amirrajan
amirrajan / main.rb
Last active October 24, 2025 13:11
DragonRuby Game Toolkit - Definitely not Wordle
class Game
attr_gtk
GREEN = { r: 98, g: 140, b: 84 }
YELLOW = { r: 177, g: 159, b: 54 }
GRAY = { r: 64, g: 64, b: 64 }
def initialize
# get the list of words that can be inputed
@valid_words = GTK.read_file("data/valid.txt")
@simi
simi / rc-wtf.md
Last active October 22, 2025 10:38
@rameerez
rameerez / kamal-production-server-setup.sh
Last active December 1, 2025 09:50
Set up a Ubuntu server to deploy Kamal 2.x Docker containers to, hardened security and production ready
#!/bin/bash
# Production Docker Host Hardening Script v2
# For Ubuntu Server 24.04 LTS (Noble)
# Suitable for both Kamal deployment and builder hosts
set -euo pipefail
IFS=$'\n\t'
# --- Constants ---
@DarkStoorM
DarkStoorM / Subject-Oriented Inpainting.md
Last active November 28, 2025 03:24
Random document on Subject-Oriented Inpainting and Detailing in Stable Diffusion + my personal workflow.

Stable Diffusion, Subject-Oriented Inpainting

Caution

24 Aug 2024 - Please keep in mind that this document is obsolete and lots of things have changed since its release, this document is not maintained in terms of technicalities. Most things still apply as I still do things with the same workflow, except the settings at this point are a "whatever" and I use Hypertile with the recent A1111 releases (switched to 1.10), so the samplers/CFG etc. settings don't really matter unless you use things like XL Turbo or whatever people release today, use whatever is recommended. Also "enhancers" in prompts are just a meme.

Table of Contents:

@watzon
watzon / promptconvert.py
Created February 22, 2023 04:22
Stable Diffusion WebUI to InvokeAI prompt conversion script
import re
import argparse
re_attention = re.compile(r"""
\\\(|
\\\)|
\\\[|
\\]|
\\\\|
\\|
@brianjbayer
brianjbayer / gist-unlocking-the-secrets-of-rails-secrets-and-credentials.md
Last active October 8, 2025 10:20
A comprehensive examination of Rails Secrets, Credentials, and Secret Key Base

Unlocking the Secrets of Rails Secrets and Credentials

Interurban Tunnel at Blackhand Gorge- Brian J Bayer


If you are like many (most?) of us, you have encountered Rails Credentials/Secrets and secret_key_base and may have been left a bit (or more) confused.

This post is an attempt to remove some of that confusion by

@whjms
whjms / kobold-8bit.md
Last active April 7, 2023 16:35
Instructions for running KoboldAI in 8-bit mode

Running KoboldAI in 8-bit mode

tl;dr use Linux, install bitsandbytes (either globally or in KAI's conda env, add load_in_8bit=True, device_map="auto" in model pipeline creation calls)

Many people are unable to load models due to their GPU's limited VRAM. These models contain billions of parameters (model weights and biases), each of which is a 32 (or 16) bit float. Thanks to the hard work of some researchers [1], it's possible to run these models using 8-bit numbers, which halves the required amount of VRAM compared to running in half-precision. E.g. if a model requires 16GB of VRAM, running with 8-bit inference only requires 8GB.

This guide was written for KoboldAI 1.19.1, and tested with Ubuntu 20.04. These instructions are based on work by Gmin in KoboldAI's Discord server, and Huggingface's efficient LM inference guide.

Requirements

# Script for converting a HF Diffusers saved pipeline to a Stable Diffusion checkpoint.
# *Only* converts the UNet, VAE, and Text Encoder.
# Does not convert optimizer state or any other thing.
# Written by jachiam
import argparse
import os.path as osp
import torch
@jaydorsey
jaydorsey / private_bundle_install_gist.md
Last active October 13, 2025 15:21
Setting up a github/bundle token for privately hosted repos

If your Gemfile has a privately hosted package referenced similar to this:

gem 'sekret', git: 'https://github.com/my-private-group/sekret.git', branch: 'main'

You may see a prompt when running bundle install, or other bundler commands, to enter your github username & password.

To resolve this, you need to generate a token and add it to your system.

Generating a token