Skip to content

Instantly share code, notes, and snippets.

@ruvnet
ruvnet / *notepad.ipynb
Last active May 15, 2024 19:57
ruv-metaprompt.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fenix-hub
fenix-hub / #description.md
Last active May 15, 2024 19:56
GDScript JSON <> Class Serializer/Deserializer

You can find usages in the GDScript Unirest plugin

This is a fast serializer/deserializer written in GDScript to convert a JSON (Dictionary) to a class, using something similar to the Reflection concecpt. json_to_class can be used to convert a Dictionary to a Class. All keys in the Dictionary will be treated as variables and their types will be guessed in the best way possible. A class (defined by the class_name keyword) must extend Reference or Object or be an inner class, or else Godot will not able to see its properties. It is also possible to deserialize a JSON key to a class property with a different name using the export hint as a variable name.

example usage:

@veekaybee
veekaybee / normcore-llm.md
Last active May 15, 2024 19:54
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@shahinghasemi
shahinghasemi / encrypt.js
Last active May 15, 2024 19:52
FullStack AES-GCM Encryption Decryption using NodeJS and Browser standard libraries (native crypto API)
//----------------------------------------------------------------
// ------------------- ServerSide(NODE.JS) -------------------
//----------------------------------------------------------------
function encrypt(message){
const KEY = crypto.randomBytes(32)
const IV = crypto.randomBytes(16)
const ALGORITHM = 'aes-256-gcm';
const cipher = crypto.createCipheriv(ALGORITHM, KEY, IV);
let encrypted = cipher.update(message, 'utf8', 'hex');
@ih2502mk
ih2502mk / list.md
Last active May 15, 2024 19:52
Quantopian Lectures Saved

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Create Free AWS Account

Create free AWS Account at https://aws.amazon.com/

2. Create and Lauch an EC2 instance and SSH into machine

I would be creating a t2.medium ubuntu machine for this demo.

@sroecker
sroecker / debug_pytorch_rocm.py
Last active May 15, 2024 19:51
If this is not crashing then PyTorch is most likely running with your AMD graphics card and ROCm, if not see magic variables
import torch
print("pytorch version: " + torch.__version__)
print("CUDA available: " + str(torch.cuda.is_available()))
print("device count: " + str(torch.cuda.device_count()))
print("current device: " + str(torch.cuda.current_device()))
print("device name: " + torch.cuda.get_device_name(torch.cuda.current_device()))
print("backend:")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print(device)
import type { V2_HtmlMetaDescriptor, V2_MetaFunction } from "@remix-run/node";
export const mergeMeta = (
overrideFn: V2_MetaFunction,
appendFn?: V2_MetaFunction,
): V2_MetaFunction => {
return arg => {
// get meta from parent routes
let mergedMeta = arg.matches.reduce((acc, match) => {
return acc.concat(match.meta || []);
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active May 15, 2024 19:48
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@Pyr-000
Pyr-000 / $README.md
Last active May 15, 2024 19:47
Convert original Stable Diffusion checkpoints and safetensors to diffusers

Stable Diffusion model conversion script

Convert from the 'original implementation' to Huggingface diffusers. Both .safetensors and .ckpt checkpoints are supported.

The script is adapted from the diffusers conversion script: https://github.com/huggingface/diffusers/blob/main/scripts/convert_original_stable_diffusion_to_diffusers.py

Usage:

python enhanced_convert_original_stable_diffusion_to_diffusers.py --checkpoint_path "<input_model_filepath>" --dump_path "<output_directory_path>" --extract_ema

For inference use, extracting with --extract_ema is usually recommended. This will be ignored if the source model does not contain both EMA and non-EMA weights.