Skip to content

Instantly share code, notes, and snippets.

View 0xdevalias's full-sized avatar
👀
Open to opportunities

Glenn 'devalias' Grant 0xdevalias

👀
Open to opportunities
View GitHub Profile
# 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
@mattmc3
mattmc3 / optparsing_demo.zsh
Last active December 2, 2025 17:37
Zsh option parsing example
# Manual opt parsing example
#
# Features:
# - supports short and long flags (ie: -v|--verbose)
# - supports short and long key/value options (ie: -f <file> | --filename <file>)
# - supports short and long key/value options with equals assignment (ie: -f=<file> | --filename=<file>)
# - does NOT support short option chaining (ie: -vh)
# - everything after -- is positional even if it looks like an option (ie: -f)
# - once we hit an arg that isn't an option flag, everything after that is considered positional
function optparsing_demo() {
@LitileXueZha
LitileXueZha / debug-react-source-code.md
Last active July 10, 2022 02:23
Debug react source code on yourself custom builds with source map.

Debug react source code on yourself custom builds with source map. First of all, read offical guide How to Contribute and be familiar with it's build flow.

Clone the repository, use specified branch or tag, eg: v16.8.0:

$ git clone --depth 1 --branch v16.8.0 [repo url]
$ cd ./react
$ yarn
...
AssertionError [ERR_ASSERTION]: Current node version is not supported for development
@dnnsmnstrr
dnnsmnstrr / btt.sh
Created August 1, 2021 18:58
Launch BetterTouchTool's named triggers from the command line. Requires the BTT webserver interface to be active.
#!/bin/bash
if [ -z "$1" ]
then
echo "No trigger supplied"
exit
fi
curl "http://127.0.0.1:12345/trigger_named/?trigger_name=$*"

1. Plug in Ledger, open Ledger Live and update device firmware to latest

Screen Shot 2021-07-07 at 9 07 44 AM

2. Go to Settings -> Expirimental Features

Screen Shot 2021-07-07 at 9 07 51 AM

3. Enable "Developer mode"

@goran-peoski-work
goran-peoski-work / lazy.ts
Last active April 13, 2024 19:44
Dynamic import of omponent
import React, { ComponentType, LazyExoticComponent } from "react";
type Transformer = <T>(name: keyof T) => (module: T) => { default: T[keyof T] };
const transformer: Transformer = (
(name) => (module) => ({ default: module[name] })
);
@supermamon
supermamon / code.js
Last active October 27, 2025 05:23
Example Google Apps Script WebApp to read/append to a Spreadsheet
/*
How to setup
============
1. Go to https://script.google.com and login
2. Click New Project
3. Give the project a name be clicking on "Untitled Project" and giving a new name
4. Copy this whole code and overwrite everything on Code.gs file. Click on the Save icon to save.
5. Go to Google drive and open the worksheet that you want to manipulate
6. Take a look at the url. It should be in this format -- https://docs.google.com/spreadsheets/d/spreadheet-id-as-some-long-seemingly-random-characters/edit#gid=478439860
@KoryNunn
KoryNunn / handshake-airdrop.md
Last active March 12, 2024 07:03
Handshake airdrop for github users.

Had 15 github followers in 2019? You can get about $4kAUD of crypto for minimal effort.

Explain this scam

That's legitimately a good default position to hold, however, in this case, the free money is a function of time, and not only charity.

In February 2020, in order to promote Handshake (HNS) to developers, an airdrop was offered to any Github user with more than 15 followers. The Airdrop would give you 4246HNS, at the time worth around at $0.08USD per coin, for a total of $339.68USD, pretty generous!

Today, 4246HNS is worth around $4000 dollarydoos, and there are plenty of github users who haven't claimed theirs.

@i001962
i001962 / gist:f9c1d0f43c7dfd11d301c9a2d8c3fbab
Last active October 7, 2022 07:55
gundb - public data that only a keypair holder may change
//document.write("<script src='https://cdn.jsdelivr.net/npm/gun/gun.js'></script>")
//document.write("<script src='https://cdn.jsdelivr.net/npm/gun/sea.js'></script>")
//var gun = Gun();
// write some gun data that is publicly accessible yet immutable to public
(async ()=>{
// Work in 'your' user nameSpace. This is just a test keypair to make it easy to try in dev console
var oldPair = {pub: "ec6y-kMl2HbmIfx3JQEGwqpZlrp7gjUaXqz5ZTVyHho.2FaHKv8rHwJPnsB1P8tHpdQACfLHElr-Fy3lZX41sRI", epub: "QKmF9qP18GsvRDy6LF2t5cdAYsJDkrfPbIKuNo-MJGQ.OBhlOXlq5DGEVo3gnvejMdK_Evg_7cgBuVtng5uf490", priv: "wvvrjoelk2sejdy22nKfieTlVB1UWl4R9d9gMqs1oFE", epriv: "lkE71r1VVCHSSKMlBu54QQ4U120h5SX-2YG1UMo_3iQ"}
user = gun.user();
// user.create(alias, pass, cb, opt) //<- should use soemthing like this instead
@ThomasG77
ThomasG77 / README.md
Last active April 24, 2025 05:05
Recipe to get JSON using pagination using command line tools e.g curl, jq, bc, cat