Skip to content

Instantly share code, notes, and snippets.

View slavfox's full-sized avatar
🦊
Testing in production

fox & circe slavfox

🦊
Testing in production
View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active April 19, 2025 12:06
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@Birch-san
Birch-san / fine-tuning.md
Last active December 27, 2023 17:24
Fine-tuning LLaMA-7B on ~12GB VRAM with QLoRA, 4-bit quantization

Fine-tuning LLaMA-7B on ~12GB VRAM with QLoRA, 4-bit quantization

nvidia-smi said this required 11181MiB, at least to train on the sequence lengths of prompt that occurred initially in the alpaca dataset (~337 token long prompts).
You can get this down to about 10.9GB if (by modifying qlora.py) you run torch.cuda.empty_cache() after PEFT has been applied to your loaded model and before you begin training.

Setup

All instructions are written assuming your command-line shell is bash.

Clone repository:

@asportnoy
asportnoy / q.fish
Last active May 9, 2023 20:02
GitHub Copilot CLI for Fish Shell
# Requires the GitHub Copilot CLI from GitHub Next
# https://www.npmjs.com/package/@githubnext/github-copilot-cli#installation-and-setup
# This needs to be set up as a function in your fish config. You can use `funced -s q` to do this.
# Options:
# q -g --git: Use github-copilot-cli git-assist
# q -h --gh: Use github-copilot-cli gh-assist
# Defaults to using what-the-shell (general command assist) if neither option is provided
# Completions for your Fish config:
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
@LotteMakesStuff
LotteMakesStuff / Flicker.cs
Created June 16, 2021 04:49
Quake/Halflife style light flicker
using UnityEngine;
public class Flicker : MonoBehaviour
{
public string LightStyle = "mmamammmmammamamaaamammma";
private Light light;
public float loopTime = 2f;
[SerializeField]
private int currentIndex = 0;
@JavadocMD
JavadocMD / index.js
Created August 3, 2020 22:38
Follow a Blaseball game for the given team and print updates to the console.
import { default as Socket } from 'socket.io-client'
// dependencies: socket.io-client
// Usage example:
// $ node ./dist/index.js "Philly Pies" | espeak-ng -v en-us -s 120
function main() {
const team = process.argv[2] || 'Philly Pies'
const socket = Socket('https://blaseball.com')
@drewtato
drewtato / VoxelTycoonControls.md
Last active June 10, 2020 04:27
Voxel Tycoon Controls

VT Controls

Camera

  • W/A/S/D, Hold Right mouse: Pan up/left/down/right
  • Q/E, Scroll: Zoom out/in
  • Ctrl+W/A/S/D, Hold Middle mouse: Rotate camera down/clockwise/up/counterclockwise
  • Numpad 1-9: Move camera constantly (when option is toggled on, 5 to reset)
  • F3: Toggle perspective/isometric mode
  • F7: Make terrain invisible forever Removed as of 0.73
@adulau
adulau / ghidra-community.md
Last active November 11, 2023 13:16
Ghidra community - collection
@rcx
rcx / delete-all-messages.js
Last active December 24, 2024 05:08 — forked from niahoo/delete-all-messages.js
Delete all your messages in a Discord channel
/*
* Discord: Don't copy stuff into this box
* Me: dOn'T COpy sTuFf iNtO tHIs bOx
*/
clearMessages = function (guild_id, author_id, authToken, deleted = new Set()) {
if (guild_id[0] == "_" && guild_id[guild_id.length - 1] == "_") {
alert("Oops! You forgot to set the guild_id. Please fill it in.")
return;
}
if (author_id[0] == "_" && author_id[author_id.length - 1] == "_") {
@josefnpat
josefnpat / Makefile
Last active February 5, 2025 05:46
Love Makefile of Doom
# Copyright 2017 Josef N Patoprsty
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all