Skip to content

Instantly share code, notes, and snippets.

View unabridgedxcrpt's full-sized avatar

Jonathan Bird unabridgedxcrpt

View GitHub Profile
@kristopherjohnson
kristopherjohnson / generate_cpp_project.py
Last active March 11, 2025 02:31
Script for generating a new CMake-based C++ project
#!/usr/bin/env python3
"""
generate_cpp_project.py
This script generates a standard C++ project structure with CMake build system.
The generated project includes:
- A main executable
- A library with header files
- Unit tests using Doctest
- CMake configuration with CPack support
@ldavidh
ldavidh / moreFinderTerminal.sh
Last active January 11, 2025 00:28
alternate sel script
#cd into directory in Finder's front window
function cdf() {
finderPath=`osascript -e 'try
tell application "Finder" to set the source_folder to (folder of the front window) as alias
on error
tell application "Finder" to set source_folder to insertion location as alias
end try
return POSIX path of source_folder as string'`
cd "$finderPath"
fn marine_line() -> String {
use rand::{seq::SliceRandom, Rng};
let marine_life = ["🐳", "🐠", "🦈", "🐙", "🐡", "🐬", "🐟", "🦀", "🐋"];
let water = [
"\x1B[38;2;0;100;200m≈\x1B[0m",
"\x1B[38;2;10;110;210m≈\x1B[0m",
"\x1B[38;2;20;120;220m≈\x1B[0m",
"\x1B[38;2;30;130;230m≈\x1B[0m",
"\x1B[38;2;40;140;240m≈\x1B[0m",
@kalomaze
kalomaze / llm_samplers_explained.md
Last active May 5, 2025 04:39
LLM Samplers Explained

LLM Samplers Explained

Everytime a large language model makes predictions, all of the thousands of tokens in the vocabulary are assigned some degree of probability, from almost 0%, to almost 100%. There are different ways you can decide to choose from those predictions. This process is known as "sampling", and there are various strategies you can use which I will cover here.

OpenAI Samplers

Temperature

  • Temperature is a way to control the overall confidence of the model's scores (the logits). What this means is that, if you use a lower value than 1.0, the relative distance between the tokens will become larger (more deterministic), and if you use a larger value than 1.0, the relative distance between the tokens becomes smaller (less deterministic).
  • 1.0 Temperature is the original distribution that the model was trained to optimize for, since the scores remain the same.
  • Graph demonstration with voiceover: https://files.catbox.moe/6ht56x.mp4
@ole
ole / set-photos-keyboard-shortcuts.sh
Last active May 4, 2024 02:10
Assign a keyboard shortcut to the Export Unmodified Originals menu command in Photos.app on macOS
#!/bin/bash
# Assigns a keyboard shortcut to the Export Unmodified Originals
# menu command in Photos.app on macOS.
# @ = Command
# ^ = Control
# ~ = Option
# $ = Shift
shortcut='@~^e'
@chockenberry
chockenberry / README
Created April 6, 2022 17:32
A simple AppleScript to start up a web server in the folder where the script is located.
1) Add this code to a new file in Script Editor
2) Export the script as "Application" and make sure it's code signed
3) Put "Startup.app" in the root folder of the test website (e.g. where index.html is located)
4) Make sure that "Startup.app" has Full Disk Access in System Preferences > Security & Privacy > Privacy
@aculich
aculich / zdl.py
Created March 29, 2021 17:48 — forked from danaspiegel/zdl.py
Zoom Recording Downloader
#!/usr/bin/env python3
import os
import requests
import itertools
from dateutil.parser import parse
API_KEY = ''
API_SECRET = ''
function getYahooPrice(symbol, datetime) {
symbol = symbol || "NSE:PANACEABIO";
// symbol = symbol.replace("NSE:", "") + ".NS";
Utilities.sleep(Math.floor(Math.random() * 5000))
var url = 'https://query1.finance.yahoo.com/v7/finance/download/'+ symbol + '?interval=1d&events=history'; // last one day history
Logger.log(url);
var response = UrlFetchApp.fetch(url, {muteHttpExceptions: true});
if (response.getResponseCode()) {
var textFile = response.getContentText();
if (textFile.indexOf("Date") != -1) {
@cliss
cliss / Brewfile
Last active January 23, 2025 11:25
Casey Liss's Brewfile, as of 31 October 2021
cask_args appdir: "/Applications"
tap "homebrew/cask-fonts"
brew "mas"
#### LAPTOPS ####
#cask "tripmode"
#### LAPTOPS ####
mas "Boop", id: 1518425043

This has been replaced by a gem

Use gem install bunchcli to install, then run bunch -h for a list of commands.