Skip to content

Instantly share code, notes, and snippets.

View jswright61's full-sized avatar

Scott Wright jswright61

View GitHub Profile
@jswright61
jswright61 / gist:de16173ad5bd6ddd7c3f2ac3e95b81bd
Created November 7, 2025 10:37
Copy of Mastodon Post on VPNS
@ErictheCerise I do!
TL;DR Logging is always technically possible, but some companies really don't keep them as a matter of policy.
If you don't care about region-shifting for video streaming, I'd recommend Mullvad.
If you don't care about speed or price, Perfect Privacy is good.
NordVPN, Surfshark (these two are related companies) and Windscribe would all be in my shortlist if I wanted to be able to watch streaming services while connected.
Now: a lot more detail
@jswright61
jswright61 / Claude prompt 1.md
Created June 27, 2025 19:39
Zsh prompt from Claude

create a zsh prompt command containing the following items in order.
The color of each item is listed before the item in parens. (blue) user name (purple) host name
(yellow) current working directory
(black) active git branch
(green) checkmark if my git repository is clean
(red) XXX if my git repository is dirty
(red) current Ruby version number

@jswright61
jswright61 / make_forward.java
Created January 10, 2025 17:04
Make Forward Function Java CSE1322 Lab 1
private static char[][] make_forward(){
char[][] pixel = new char[4][13];
pixel[0][0]=' ';
pixel[0][1]=' ';
pixel[0][2]=' ';
pixel[0][3]='_';
pixel[0][4]='_';
pixel[0][5]='_';
pixel[0][6]='_';
pixel[0][7]='_';
@jswright61
jswright61 / find_people_by_name.sparql
Created January 6, 2025 18:33
SPARQL Queries against Wikidata
SELECT distinct ?item ?itemLabel ?itemDescription # (SAMPLE(?birth) as ?birth_date)
WHERE{
?item ?label "Shannen Doherty"@en.
?item wdt:P31 wd:Q5.
# ?id wdt:P569 ?birth .
?article schema:about ?item .
?article schema:inLanguage "en" .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
SELECT DISTINCT
?id
?idLabel
(SAMPLE(?birth) as ?birth_date)
(SAMPLE(?death_date) as ?dateOfDeath)
(SAMPLE(?manner_of_death) as ?mannerOfDeath)
(SAMPLE(?cause_of_death) as ?causeOfDeath)
WHERE {
?id wdt:P31 wd:Q5.
@jswright61
jswright61 / ordinalize.py
Created November 29, 2024 16:10
Ordinalize an integer
#!/opt/homebrew/bin/python3
import sys
def ordinalize(n):
if n % 100 in (11, 12, 13):
return f"{n}th"
else:
match n % 10:
case 1:
@jswright61
jswright61 / selected_photos_filenames
Created September 19, 2024 09:30
Applescript to get the filenames of the currently selected Photos in Apple Photos
tell application "Photos"
activate
set thePhotosFiles to {}
set imageSel to (get selection) -- get the selected image
repeat with im in imageSel
set thePhotosFiles to the ({filename of im} & thePhotosFiles)
end repeat
@jswright61
jswright61 / gist:e038e30655ef66c70eb7e1fa8e87eccf
Created March 7, 2023 20:18
AppleScript to OCR a PDF using PDFPenPro
tell application "PDFpenPro"
open theFile as alias
-- Does the document need to be OCR'd?
get the needs ocr of document 1
if result is true then
tell document 1
ocr
@jswright61
jswright61 / level_up.txt
Created March 8, 2022 13:34
Level Up Email Source
Return-Path: <[email protected]>
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
by sloti44n19 (Cyrus 3.5.0-alpha0-4778-g14fba9972e-fm-20220217.001-g14fba997) with LMTPA;
Tue, 08 Mar 2022 01:01:47 -0500
X-Cyrus-Session-Id: sloti44n19-1646719307-794636-5-17851835402845090288
X-Sieve: CMU Sieve 3.0
X-Spam-known-sender: no
X-Spam-sender-reputation: 500 (none)
X-Spam-score: 0.3
X-Spam-hits: BAYES_00 -1.9, HEADER_FROM_DIFFERENT_DOMAINS 0.249, HTML_MESSAGE 0.001,
@jswright61
jswright61 / wordle_stats.html
Last active February 14, 2022 19:13
Wordle Stats Update
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Update Wordle Statistics</title>
<style>
/* Global Styles & Colors */
:root {
--green: #6aaa64;
--darkendGreen: #538d4e;