Skip to content

Instantly share code, notes, and snippets.

@OrionReed
OrionReed / DOM3D.js
Last active March 28, 2024 23:11
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; // ¯\\_(ツ)_/¯
@edsunman
edsunman / ThrelteUtils.ts
Last active March 28, 2024 23:11
Threlte Utilities
/**
* Returns a function that can be used to execute a child function every given number of seconds.
* @param interval - The interval in seconds.
* @param [randomMax]- The interval will be random, using this value as the upper bound and the interval param as the lower bound.
* @example
*
* const everyFiveSeconds = interval(5)
*
* useTask((delta) => {
* everyFiveSeconds(delta, () => {
@troyfontaine
troyfontaine / 1-setup.md
Last active March 28, 2024 23:11
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

git clone https://github.com/cpacker/MemGPT.git
conda create -n memgpt python=3.10
conda activate memgpt
cd memgpt
pip install -r requirements.txt
export OPENAI_API_KEY="YOUR_API_KEY"
# download .txt docs from: https://huggingface.co/datasets/MemGPT/example-sec-filings/tree/main
# place in "memgpt/personas/examples/preload_archival/*.txt"
python3 main.py --archival_storage_files_compute_embeddings="memgpt/personas/examples/preload_archival/*.txt" --persona=memgpt_doc --human=basic
@subfuzion
subfuzion / curl.md
Last active March 28, 2024 23:11
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@silver-xu
silver-xu / ts-boilerplate.md
Last active March 28, 2024 23:08
Setup a Node.js project with Typescript, ESLint, Prettier, Husky

Setup a Node.js project with Typescript, ESLint, Prettier, Husky

1_D8Wwwce8wS3auLAiM3BQKA

Starting a personal node project could be easy; starting a team node project could be challenging.

I am a developer currently working in SEEK Australia.

In my experience, common mistakes developer make when starting a projects are:

  • No Linting
@ditzel
ditzel / PhysicsHelper.cs
Created January 20, 2019 16:54
Unity Helper for Physic Functions
using UnityEngine;
namespace Ditzelgames
{
public static class PhysicsHelper
{
public static void ApplyForceToReachVelocity(Rigidbody rigidbody, Vector3 velocity, float force = 1, ForceMode mode = ForceMode.Force)
{
if (force == 0 || velocity.magnitude == 0)
@PaulBraetz
PaulBraetz / booklist.md
Last active March 28, 2024 23:07
Cool Books I Like
  • CLR via C# 9780735667457
  • Refactoring 9780134757599
  • The Practice Of Programming 9780201615869
  • Everyware 9780321384010
  • Simple And Usable 9780134777603
  • C# In Depth 9781617294532
  • Dependency Injection 9781617294730
  • Design Patterns GOF 9780201633610
  • The C Programming Language 9780131103627
  • Learning Domain-Driven Design 9781098100131
@0xdevalias
0xdevalias / _deobfuscating-unminifying-obfuscated-web-app-code.md
Last active March 28, 2024 23:06
Some notes and tools for reverse engineering / deobfuscating / unminifying obfuscated web app code
@astronotter
astronotter / io_export_anim.py
Created July 10, 2020 08:46
Blender exporter for saving animations as a csv file.
bl_info = {
"name": "Export Camera Animation",
"author": "ottle",
"version": (0, 1),
"blender": (2, 80, 0),
"location": "File > Export > Animation (.csv)",
"description": "Export Animation (.csv)",
"warning": "",
"wiki_url": "",
"support": 'COMMUNITY',