Skip to content

Instantly share code, notes, and snippets.

@jbaranski
jbaranski / README
Created November 10, 2025 15:11 — forked from shmookey/README
3103 common 5-letter words
this word list comprises the intersection of 5 letter words occurring in three source lists:
- wikipedia's list of most 100k most common words in the english language
- the american english dictionary file on my laptop
- the british english dictionary file on my laptop
the source lists are sanitised by dropping words that contain non-alphabetic or non-ascii
characters and converting capitals to lowercase.
only words that occur in all three resulting lists are kept.
@jbaranski
jbaranski / uv_print_virtualenvironment
Created July 4, 2025 01:22
uv CLI with embedded dependencies print out the virtual environment location
#!/usr/bin/env -S uv run --script
#
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "typer"
# ]
# ///
import os
import sys
@jbaranski
jbaranski / db.json
Last active December 28, 2024 00:51
Open Trivia DB data dump (opentdb.com)
This file has been truncated, but you can view the full file.
[
{
"type": "multiple",
"difficulty": "medium",
"category": "Entertainment: Video Games",
"question": "What is the world's first video game console?",
"correct_answer": "Magnavox Odyssey",
"incorrect_answers": [
"Coleco Telstar",
"Nintendo Color TV Game",
@jbaranski
jbaranski / shell.sh
Last active September 29, 2024 19:40
MacBook increase display brightness on the command line
# Increase display brightness command
osascript -e 'tell application "System Events"' -e 'key code 144' -e ' end tell'
# Decrease display brightness command
osascript -e 'tell application "System Events"' -e 'key code 145' -e ' end tell'
# zsh solution to turn it all the way up on one command, just run `b` on the cmd line
alias bright="osascript -e 'tell application \"System Events\"' -e 'key code 144' -e ' end tell'"
alias b="repeat 10 { bright }"
@jbaranski
jbaranski / shell.sh
Last active September 10, 2023 14:45
How to fix: "chromedriver" can’t be opened because Apple cannot check it for malicious software.
# How to fix: "chromedriver" can’t be opened because Apple cannot check it for malicious software.
xattr -d com.apple.quarantine /opt/homebrew/bin/chromedriver
@jbaranski
jbaranski / trivia_download.py
Last active October 13, 2025 21:11
Download all questions from Open Trivia DB (opentdb.com)
import requests
import json
import time
if __name__ == '__main__':
db = {}
token = requests.get('https://opentdb.com/api_token.php?command=request').json()['token']
while True:
r = requests.get(f'https://opentdb.com/api.php?amount=50&token={token}')
r_json = r.json()
@jbaranski
jbaranski / ffmpeg_mac_m1_record_cmd_line.md
Last active March 11, 2025 04:02
ffmpeg record screen on Mac M1 chip via command line

ffmpeg record screen on Mac M1 chip via command line

  1. Install ffmpeg.

brew install ffmpeg

  1. Figure out which device to use.

ffmpeg -f avfoundation -list_devices true -i ""

Ouput will look like:

@jbaranski
jbaranski / wordle_game_num_to_date.json
Last active May 14, 2022 23:48
Wordle game number to date map
{
"1": "2021-06-20",
"2": "2021-06-21",
"3": "2021-06-22",
"4": "2021-06-23",
"5": "2021-06-24",
"6": "2021-06-25",
"7": "2021-06-26",
"8": "2021-06-27",
"9": "2021-06-28",
@jbaranski
jbaranski / OracleOpenPort80Centos.md
Created September 26, 2020 02:00
Open Port 80 Oracle Cloud Compute Instance (CentOS)

Open Port 80 Oracle Cloud Compute Instance (CentOS)

FYI This was harder than it needed to be:

  1. Looking at your instance info, find VNIC section, click "Public Subnet".
  2. Click on your security list.
  3. Add a new entry with the following options:
  • "Stateless" = No, "Source" = 0.0.0.0/0, "IP Protocol" = TCP, "Source Port Range" = All, "Destination Port Range" = 80
  1. SSH to your instance.
  2. While SSH'ed in your instance, run command firewall-cmd --permanent --add-service=http.
  3. While SSH'ed in your instance, run command firewall-cmd --reload.
  4. Now start Apache, NGINX, or whatever server you need to on port 80. You can now access from the internet.
@jbaranski
jbaranski / Img2MBTilesWithGDAL.md
Created August 1, 2020 14:52
Convert an image (like JPG or TIF) to MBTiles using GDAL

Here are the steps needed to convert an image (like JPG or TIF) to MBTiles using GDAL:

  1. Download and install GDAL (https://gdal.org/, https://anaconda.org/conda-forge/gdal):

       conda install -c conda-forge gdal
    

    Installing GDAL is kind of a pain in the ass, especially on Windows. I'm assuming you'll be able to work out whatever issues you run into here.

  2. Download example jpg and tif map images we can work with: