Skip to content

Instantly share code, notes, and snippets.

@AmericanPresidentJimmyCarter
AmericanPresidentJimmyCarter / flux_lora_cfg.py
Created August 10, 2024 19:30
Use your flux-dev LoRA with a quantized model and CFG in <16gb VRAM
import inspect
from typing import Any, Callable, Dict, List, Optional, Union
import numpy as np
import torch
from transformers import CLIPTextModel, CLIPTokenizer, T5EncoderModel, T5TokenizerFast
from diffusers.image_processor import VaeImageProcessor
from diffusers.loaders import FluxLoraLoaderMixin
from diffusers.models.autoencoders import AutoencoderKL
@nat-418
nat-418 / nix-home-manager-neovim-setup.md
Last active February 11, 2025 03:36
Manage Neovim plugins (and more!) with Nix and Home Manager

Manage Neovim plugins (and more!) with Nix and Home Manager

Highly extensible software like Emacs, Vim, and Neovim tend to grow their own package managers. A software developer, for example, might want to install editor plugins that hook into a particular programming language's linter or language server. The programmer's text editor is therefore extended to support managing additional software to extend the text editor. If this loop continues for too long, the programmer's editor becomes more delicate and complex. The remedy for this problem is to manage software using dedicated tools apart

@danwagnerco
danwagnerco / wifeyalpha_books.md
Last active November 19, 2024 00:49
WifeyAlpha recommended reading
@yxztj
yxztj / TaskConcurrencyManifesto.md
Last active January 4, 2025 14:32 — forked from lattner/TaskConcurrencyManifesto.md
Swift Concurrency Manifesto 中文翻译
const {useCallback, useEffect, useReducer, useRef} = require('react');
let effectCapture = null;
exports.useReducerWithEmitEffect = function(reducer, initialArg, init) {
let updateCounter = useRef(0);
let wrappedReducer = useCallback(function(oldWrappedState, action) {
effectCapture = [];
try {
let newState = reducer(oldWrappedState.state, action.action);
@dayne
dayne / 0-WLS_Removing Win Path.md
Last active June 23, 2024 06:08
Cleaning up WLS path to remove /mnt/c paths (world writable).

The Windows Linux Subsystem (WSL) comes with /win/c mounted world read-write and is setup for compatibility between windows and linux by putting all your windows paths into your linux system path. This is great for some usecases. Some tools get grumpy having these world writable directories a users path. While this doesn't break them but it can cause annoying warning messages.

On the other hand, when you don't care about the windows tools being in your path, it might make you more sane not to see those error messages, and also to limit the number of places tools look for supporting binaries not-relevant to themselves.

: warning: Insecure world writable dir /mnt/c in PATH, mode 040777

You can remove all those /mnt/c paths from your $PATH with the following line:

@hediet
hediet / main.md
Last active February 27, 2025 19:44
Proof that TypeScript's Type System is Turing Complete
type StringBool = "true"|"false";


interface AnyNumber { prev?: any, isZero: StringBool };
interface PositiveNumber { prev: any, isZero: "false" };

type IsZero<TNumber extends AnyNumber> = TNumber["isZero"];
type Next<TNumber extends AnyNumber> = { prev: TNumber, isZero: "false" };
type Prev<TNumber extends PositiveNumber> = TNumber["prev"];
@0xjac
0xjac / private_fork.md
Last active February 27, 2025 13:04
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?