Skip to content

Instantly share code, notes, and snippets.

View eshack94's full-sized avatar

Elijah Shackelford eshack94

View GitHub Profile
@willccbb
willccbb / grpo_demo.py
Last active April 25, 2025 22:27
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
@VictorTaelin
VictorTaelin / gpt4_abbreviations.md
Last active March 17, 2025 17:41
Notes on the GPT-4 abbreviations tweet

Notes on this tweet.

  • The screenshots were taken on different sessions.

  • The entire sessions are included on the screenshots.

  • I lost the original prompts, so I had to reconstruct them, and still managed to reproduce.

  • The "compressed" version is actually longer! Emojis and abbreviations use more tokens than common words.

@debakarr
debakarr / kodekloud_course_decks.md
Last active April 24, 2025 16:22
Course decks for KodeKloud
@pythoninthegrass
pythoninthegrass / .bash_aliases
Last active April 25, 2025 18:57
Bash shell config (~/.bashrc) for Intel and ARM Macs
# shellcheck disable=all
# PATH
# export CODE="${VSCODE_GIT_ASKPASS_NODE%/*}/bin/remote-cli"
# export PATH="$CODE:$HOME/.asdf/shims:$PATH"
# check if binary exists
check_bin() { command -v "$1" >/dev/null 2>&1; }
# aliases
@tuansoibk
tuansoibk / cryptography-file-formats.md
Last active April 10, 2025 20:30
Cryptography material conversion and verification commands
  1. Introduction
  2. Standards
  3. Common combinations
  4. Conversion
  5. Verification/Inspection
  6. Tips for recognising

Introduction

It happens that there are many standards for storing cryptography materials (key, certificate, ...) and it isn't always obvious to know which standard is used by just looking at file name extension or file content. There are bunch of questions on stackoverflow asking about how to convert from PEM to PKCS#8 or PKCS#12, while many tried to answer the questions, those answers may not help because the correct answer depends on the content inside the PEM file. That is, a PEM file can contain many different things, such as an X509 certificate, a PKCS#1 or PKCS#8 private key. The worst-case scenario is that someone just store a non-PEM content in "something.pem" file.

@adryd325
adryd325 / discord-voice.lsrules
Last active January 16, 2025 00:00
Little Snitch rules for Discord voice servers
{
"name": "Discord RTC Regions",
"description": "allowlist for all Discord voice regions",
"rules": [
{
"action": "allow",
"process": "/Applications/Discord.app/Contents/MacOS/Discord",
"remote-addresses": "5.200.3.71,5.200.3.100,5.200.3.119,5.200.6.179,5.200.14.132,5.200.14.138,5.200.14.172,5.200.14.186,5.200.14.196,5.200.14.231,5.200.14.243,31.204.133.6,31.204.133.9,31.204.133.14,31.204.133.16,31.204.133.22,31.204.133.27,31.204.133.30,31.204.133.31,31.204.133.37,31.204.133.43,31.204.133.44,31.204.133.48,31.204.133.49,31.204.133.52,31.204.133.58,31.204.133.74,31.204.133.76,31.204.133.80,31.204.133.81,31.204.133.82,31.204.133.87,31.204.133.95,31.204.133.97,31.204.133.101,31.204.133.102,31.204.133.103,31.204.133.104,31.204.133.105,31.204.134.11,31.204.134.16,31.204.134.19,31.204.134.26,31.204.134.28,31.204.134.30,31.204.134.32,31.204.134.34,31.204.134.36,31.204.134.40,31.204.134.50,31.204.134.54,31.204.134.58,31.204.134.61,31.204.134.63,31.204.134.64,31.204.134.69,31.204.134.72,31.2
@rajbos
rajbos / Get-JWTToken.ps1
Last active March 11, 2025 05:59
Load jwt token from GitHub App for authentication
# code to load the JWT token in PowerShell
# Call teh Get-JWTToken method with the App ID and the App Private Key (normal string from env var or file contents, make sure there is no extra line ending at the end of it!).
function Build-Payload {
Param (
[string] $app_id
)
$iat = [Math]::Floor([decimal](Get-Date(Get-Date) -UFormat %s))
$payload = @{
"iat" = [int]$iat # issues at = now
@cubic3d
cubic3d / diff-hr-on-pr.yaml
Last active May 6, 2024 22:31
GitHub Actions workflow to create a resource diff on HelmRelease PRs
name: Create diff on updated HelmReleases
on:
pull_request:
branches:
- master
paths:
- "clusters/**.yaml"
env:
@dhinakg
dhinakg / tutorial.md
Last active September 16, 2024 13:12
iOS/iPadOS 14.3 OTA
@davidmroth
davidmroth / .bash_profile
Last active November 11, 2022 01:04
Homebrew Setup Mac M1
# !!! IMPORTANT
# Must point to the correct director or this entire script breaks
eval $(/opt/homebrew/bin/brew shellenv)
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/usr/local/google-cloud-sdk/path.bash.inc' ]; then . '/usr/local/google-cloud-sdk/path.bash.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/usr/local/google-cloud-sdk/completion.bash.inc' ]; then . '/usr/local/google-cloud-sdk/completion.bash.inc'; fi