If you have uv installed (and you should!), you can install llm globally in a uv-managed tool environment with:
uv tool install llmIf you want to use models other than OpenAI models, you'll need some extensions:
| #!/usr/bin/env ruby | |
| # frozen_string_literal: true | |
| # ripple - A simple Ruby script to create a text ripple effect in the terminal. | |
| ## From the command line, you can run: | |
| # $ ruby ripple "Your Text Here" --speed fast --rainbow --direction bidirectional | |
| ## Run a command during the animation: | |
| # $ ruby ripple "Your Text Here" --speed fast --rainbow --direction bidirectional --command "sleep 5" | |
| # This will animate the text "Your Text Here" with the specified options, and run the command in the background. |
| #!/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 |
| #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" |
| // Update 2025-05-22 — ported to rand v0.9, using a struct with Display impl rather than returning a string | |
| struct MarineLine; | |
| impl std::fmt::Display for MarineLine { | |
| fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | |
| use rand::{Rng, seq::IndexedRandom}; | |
| let marine_life = ["🐳", "🐠", "🦈", "🐙", "🐡", "🐬", "🐟", "🦀", "🐋"]; | |
| let water = [ |
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.
| #!/bin/bash | |
| # Assigns a keyboard shortcut to the Export Unmodified Originals | |
| # menu command in Photos.app on macOS. | |
| # @ = Command | |
| # ^ = Control | |
| # ~ = Option | |
| # $ = Shift | |
| shortcut='@~^e' |
| 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 |
| #!/usr/bin/env python3 | |
| import os | |
| import requests | |
| import itertools | |
| from dateutil.parser import parse | |
| API_KEY = '' | |
| API_SECRET = '' |