Skip to content

Instantly share code, notes, and snippets.

View benjiwheeler's full-sized avatar

Ben Wheeler benjiwheeler

View GitHub Profile
@benjiwheeler
benjiwheeler / gitcheatsheet.md
Created October 31, 2025 17:27
Git intro cheatsheet

🧰 Git Basics Cheat Sheet

Topic Purpose Command / Action Notes
Install Git Install Git on your computer macOS: brew install git
Ubuntu/Debian: sudo apt update && sudo apt install git
Windows: git-scm.com/downloads
Windows users should install Git Bash
Configure user info Set your name and email for commits git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Run once per computer; use git config --list to verify
Authenticate with GitHub Enable push/pull access SSH method:
ssh-keygen -t ed25519 -C "[email protected]"
cat ~/.ssh/id_ed25519.pub → add key on GitHub → Settings → SSH Keys
SSH is recommended for long-term setup
Start a repo Create a Git repository in a folder git init Creates a hidden .git folder
Add files Track all files in the direct
@benjiwheeler
benjiwheeler / deployToGithubPages.md
Created October 15, 2025 16:48
How to deploy a local Claude Code web project to Github
  1. open a terminal (on Mac, you can use the "Terminal" application). In these instructions, when it says "run some command", that means to type or copy/paste that command into a prompt in your terminal.
  2. have a directory with code in it, with an index.html file that does what you want when you view it in a browser. Navigate into that directory in the terminal, using the cd command, like: cd ~/somefolder/someotherfolder/whereyourcodeis/
  3. have the git program installed (you can check if it is installed by running which git; if it does nothing, git is not installed. If it shows you a directory path that ends in "git", it is installed.)
  4. in a separate terminal window, navigate to your same code directory, and run Claude Code using claude
  5. go to github.com; create an account if you don't have one.
  6. create a GitHub project; call it whatever you want (I suggest not using spaces)
  7. once it's created, you'll see a page that says "Quick setup". Under it should be a section called "…or create a n
@benjiwheeler
benjiwheeler / llm-coding-instructions.md
Last active January 7, 2025 14:22
LLM coding preferences

My preferences as a coder

Adapted from @tom-doerr

  1. Variable Naming:
    • Use explicit, type-indicating prefixes for numeric values (e.g., numFireTokens vs fire)
    • Prefer descriptive suffixes that indicate the data's purpose (e.g., maxWaterTokens, fireSpaces)
    • Avoid ambiguous single-word names that could represent multiple concepts
@benjiwheeler
benjiwheeler / gist:2ab634a61cc4ad0c45a3e5062736bb27
Created January 12, 2024 05:10
gcalcli add event template
gcalcli --client-id=IDHERE.apps.googleusercontent.com --client-secret=SECRETHERE add --calendar "CALENDARNAMEHERE" --duration 120 --where "Brattle Theater, Cambridge, MA" --noprompt --when "1/1/2024 5:00pm" --title "Lunch with mom"
@benjiwheeler
benjiwheeler / todoist_better_today_filter.txt
Last active December 13, 2022 04:13
Todoist filter code to show series of sections, designed to put most immediately actionable items first, and then to order roughly on priority. Mixes in a selection of future dates, with the assumption that there are fewer tasks due per day the farther you get into the future; the idea is to allow you to see and work on items which are not due y…
p1 & (@small | @morning) & !@evening & today, p2 & (@small | @morning) & !@evening & today, p3 & (@small| @morning) & !@evening & today, p1 & !@small & !@morning & !@evening & (today | !@date-specific & ((due after: +2 days & due before: +4 days) | (due after: +9 days & due before: +12 days) | (due after: +35 days & due before: +40 days) | (due after: +75 days & due before: +85 days))), p2 & !@small & !@morning & !@evening & (today | !@date-specific & ((due after: +9 days & due before: +12 days) | (due after: +35 days & due before: +40 days) | (due after: +75 days & due before: +85 days))), p3 & !@small & !@morning & !@evening & (today | !@date-specific & ((due after: +9 days & due before: +12 days) | (due after: +35 days & due before: +40 days) | (due after: +75 days & due before: +85 days))), overdue & @small, No priority & !@evening & today, @evening & today
@benjiwheeler
benjiwheeler / threadtest.py
Last active February 1, 2021 19:22
python thread test
import time
import timeit
from multiprocessing.dummy import (Pool, TimeoutError)
def delay(mynum, delay_secs):
print("starting #%s" % mynum)
time.sleep(delay_secs)
print("done with #%s" % mynum)
return True
@benjiwheeler
benjiwheeler / layout_boilerplate.html
Last active January 21, 2021 17:45
HTML, CSS layout boilerplate with header, footer, responsive content width; source https://jsbin.com/tocuguw
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://code.jquery.com/jquery-git.js"></script>
<script language="JavaScript">
$( document ).ready(function() {
$("#add").on("click", function() {
@benjiwheeler
benjiwheeler / selenium_browse_back.js
Created December 19, 2018 13:27
Selenium test code for browsing back and confirming that page is gone
elementIsVisible (element) {
return this.driver.wait(until.elementIsVisible(element));
}
elementIsNotVisible (element) {
return this.driver.wait(until.elementIsNotVisible(element));
}
const abbyElement = await findByText('Abby'); // Should show editor for new costume
await elementIsVisible(abbyElement);
@benjiwheeler
benjiwheeler / selenium_wait_until_clickable.js
Last active December 19, 2018 13:26
selenium js 3.6 attempt to wait until element is clickable
const costumesTabElement = await findByText('Costumes');
await driver.wait(() => {
return costumesTabElement.isDisplayed().then(displayed => {
console.log('got here A');
if (!displayed) return false;
console.log('got here B');
// costumesTabElement.click();
return costumesTabElement.isEnabled();
});
@benjiwheeler
benjiwheeler / time_utils.py
Last active February 2, 2018 20:37
Python time utils
import datetime
import pytz
# careful, don't assume now() is nyc time! on ec2, it's utc time.
def datetime_from_tz_naive_nyc_to_tz_aware_utc(nyc_datetime_tz_naive):
nyc_datetime_tz_aware = pytz.timezone('US/Eastern').localize(nyc_datetime_tz_naive)
return nyc_datetime_tz_aware.astimezone(pytz.utc)
def utc_tz_aware(utc_datetime_tz_naive):
return pytz.timezone('UTC').localize(utc_datetime_tz_naive)