Skip to content

Instantly share code, notes, and snippets.

View connorshea's full-sized avatar
:shipit:
Shipping

Connor Shea connorshea

:shipit:
Shipping
View GitHub Profile
https://wormhole.app/MBKn6#nztdHM323zzWZ5Iapf1u3g
@connorshea
connorshea / web-development.md
Last active December 21, 2022 08:36
Web Development Notes

Some notes on making a website using HTML5, CSS, and JavaScript.

Learning HTML, CSS, and JavaScript

Useful HTML/CSS/JS Features

@connorshea
connorshea / wikidata_queries.md
Last active August 4, 2022 01:44
Some simple, useful SPARQL queries I've written to help match PCGamingWiki articles to Wikidata items.

Some Wikidata queries I've written.

https://query.wikidata.org

Items with PCGW ID and 'n/a' description

Items with PCGamingWiki ID (P6337) and the english description 'n/a'.

This query catches a problem caused by creation of new items when running Mix'n'Match with the PCGW dataset. The Mix'n'match dataset lacks proper descriptions, which has an unintended side effect of new items being created with the description 'n/a'.

ANIME_SPECIFIC_PROPERTIES = [
'P1811', # list of episodes
'P1113', # number of episodes
'P364', # original language of film or TV show
'P449', # original broadcaster
'P2047', # duration
'P86', # composer
'P57', # director
@connorshea
connorshea / gdq-parser-helper.rb
Last active July 2, 2022 18:45
Proof-of-concept script that scrapes the GDQ schedule page and then pulls the vglist and IGDB IDs from the vglist API. This'd then be used to pull cover data and such from IGDB. It doesn't get every game in the schedule, but it can get most of them automatically, which will reduce the amount of manual effort involved in setting up the data for a…
require 'json'
gdq_schedule = JSON.parse(File.read('gdq.json'))
total_entries = gdq_schedule.count
puts "Total entries: #{total_entries}"
game_only_entries = gdq_schedule.filter { |entry| !entry['non_game'] }.count
puts "Game-only entries: #{game_only_entries}"
entries_with_vglist_ids = gdq_schedule.filter { |entry| !entry['vglist_id'].nil? }.count
puts "Entries with vglist IDs: #{entries_with_vglist_ids} (#{(entries_with_vglist_ids.fdiv(game_only_entries) * 100).round(2)}%)"
@connorshea
connorshea / pygameinstall.md
Last active June 15, 2022 23:54
Installing Homebrew, Python, and Pygame on OS X
  1. Open the Terminal.
  2. Install Homebrew.
  1. Install Python 2.7 with brew install python
  • Optionally you can also install Python 3 with brew install python3
  • Installing either of these with install pip and pip3 respectively, a package manager for Python.
  1. Install prerequisites for pygame: brew install sdl sdl_image sdl_mixer sdl_ttf portmidi mercurial
  2. Install pygame using pip with pip install hg+http://bitbucket.org/pygame/pygame
@connorshea
connorshea / renew-gpg-key.md
Last active January 26, 2022 18:03
Renewing your GPG Key

See here: https://www.g-loaded.eu/2010/11/01/change-expiration-date-gpg-key/

  • Need to figure out your key ID (check the recent commits you've made on GitHub, probably? Or use gpg --list-secret-keys --keyid-format LONG)
  • gpg --edit-key ID_GOES_HERE
  • expire
  • Set the expiration to whenever (1 year is probably fine)
  • save
  • Check gpg --list-keys and gpg --list-secret-keys to make sure the keys now have updated dates.
  • Delete the existing key (for work, you probably only have the one that's associated to your work email) in your GitHub GPG settings and re-generate a public key with gpg --armor --export KEY_ID_HERE. (If you try to upload the newly-renewed key without deleting the old key, GitHub won't let you upload it.)
  • Use that new public key to create a new key in GitHub's GPG settings.
@connorshea
connorshea / sorbet-rails-check.svg
Created July 5, 2021 19:18
TypedObject#name with typechecking vs without typechecking. For a PR that improves the performance of Parlour
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@connorshea
connorshea / README.md
Last active July 5, 2020 19:28
JSON array of games on vglist that have a Wikidata ID but the Wikidata item has no vglist ID property.

JSON array of games on vglist that have a Wikidata ID but the Wikidata item has no vglist ID property. These aren't added automatically because the names on vglist and Wikidata differ. Someone should go through each of these (possibly with a simple script that'll automatically open each item in your browser) and let you decide whether they match, but not me because I'm lazy.

@connorshea
connorshea / activestorage_with_custom_logger.log
Created May 11, 2020 01:39
Rails' logs when loading a page with 15 images, comparison between the default logger and a custom logger.
=> Booting Puma
=> Rails 6.0.3 application starting in development
=> Run `rails server --help` for more startup options
Puma starting in single mode...
* Version 4.3.3 (ruby 2.6.5-p114), codename: Mysterious Traveller
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://127.0.0.1:3000
* Listening on tcp://[::1]:3000
Use Ctrl-C to stop