Skip to content

Instantly share code, notes, and snippets.

View fire's full-sized avatar

K. S. Ernest (iFire) Lee fire

View GitHub Profile
@willccbb
willccbb / grpo_demo.py
Last active April 19, 2025 20:50
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
@sorentwo
sorentwo / simple_migration.exs
Created September 2, 2024 16:47
A simplified Oban migration that's compatible with CockroachDB
execute """
CREATE TYPE oban_job_state AS ENUM (
'available',
'scheduled',
'executing',
'retryable',
'completed',
'cancelled',
'discarded'
)
@mrcdk
mrcdk / globals.gd
Created August 16, 2023 13:28
Godot 4.x example of how to launch multiple instances and tile them by using an editor debugger plugin to communicate with each instance
# res://globals.gd added as an autoload
extends Node
func _ready() -> void:
EngineDebugger.register_message_capture("tile-instances", _on_tile_instances)
EngineDebugger.send_message.call_deferred("tile-instances:get_id", [])
from langchain.llms import Anthropic
from langchain.agents import load_tools, initialize_agent
from langchain.tools import AIPluginTool
PREFIX = """\n\nHuman: Answer the following questions as best you can. You have access to the following tools:"""
SUFFIX = """Begin!
Question: {input}
\n\nAssistant:
Thought:{agent_scratchpad}"""
@JosephCatrambone
JosephCatrambone / DecisionTree.gd
Created February 25, 2022 04:32
Basic Decision Tree in GDScript
# Sample Usage:
# var day_features = [
# # freezing, raining, foggy, sunny
# [0, 1, 0, 0],
# [0, 0, 0, 1],
# [0, 0, 0, 0],
# [0, 0, 1, 0],
# [1, 0, 0, 1],
# [1, 1, 0, 0],
# [1, 0, 1, 0],
@WolfgangSenff
WolfgangSenff / gist:168cb0cbd486c8c9cd507f232165b976
Last active February 15, 2025 13:44
Godot 4.0 Migration/Upgrade guide
## For a beginner-friendly version of the following (more advanced users likely will get better use of the below,
## if you're just starting out...), see this new gist:
## https://gist.github.com/WolfgangSenff/0a9c1d800db42a9a9441b2d0288ed0fd
This document represents the beginning of an upgrade or migration document for GDScript 2.0 and Godot 4.0. I'm focusing on 2D
at the moment as I'm upgrading a 2D game, but will hopefully have more to add for 3D afterward.
## If you want more content like this, please help fund my cat's medical bills at https://ko-fi.com/kyleszklenski - thank you very much! On to the migration guide.
@PJUllrich
PJUllrich / big-o.md
Last active February 13, 2025 23:48
Big-O Time Complexities for Elixir Data Structures

Big-O Time Complexities for Elixir data structures

Map [1]

Operation Time Complexity
Access O(log n)
Search O(log n)
Insertion O(n) for <= 32 elements, O(log n) for > 32 elements [2]
Deletion O(n) for <= 32 elements, O(log n) for > 32 elements
@mcheshkov
mcheshkov / build.sh
Last active December 6, 2024 21:38
Building OpenZFS for Fedora CoreOS
#!/bin/bash
FEDORA_MAJOR="38"
ARCH="x86_64"
KERNEL_VERSION="6.3.8-200.fc38"
ZFS_VERSION="2.1.12"
podman run \
--interactive \
--tty \
@hakanai
hakanai / pmx21.md
Last active February 18, 2023 17:28 — forked from felixjones/pmx21.md
PMX (Polygon Model eXtended) 2.0, 2.1 File Format Specifications

PMX (Polygon Model eXtended) 2.1

This is an English description of the .PMX file format used in Miku Miku Dance (MMD).

PMX is the successor to the .PMD format (Polygon Model Data).

This is work-in-progress! Please leave feedback in the comments.

Todo

@pojntfx
pojntfx / main.sh
Last active October 10, 2023 14:26
Enable Wayland for VSCode/VSCodium on Linux
#!/bin/bash
# VSCodium:
sudo mv /usr/bin/codium /usr/bin/codium.original
echo '/usr/bin/codium.original --enable-features=UseOzonePlatform --ozone-platform=wayland "$1"' | sudo tee /usr/bin/codium
sudo chmod +x /usr/bin/codium
# VSCode: