Skip to content

Instantly share code, notes, and snippets.

@bkyle
bkyle / mdNotes.js
Last active June 8, 2021 13:54
mdNotes
(function() {
function highlight(span) {
const dataAnnotationContent = decodeURIComponent(span.getAttribute("data-annotation"))
const dataAnnotation = JSON.parse(dataAnnotationContent)
const citationItem = dataAnnotation.citationItem
const uri = dataAnnotation.uri
const id = uri.split("/").pop()
const text = dataAnnotation.text
const position = dataAnnotation.position
const pageIndex = position.pageIndex + 1
@bkyle
bkyle / dismiss-notifications
Created January 15, 2022 15:50
Applescript to dismiss all "drive not ejected properly" notifications. This can be run as a script at the terminal, setup as a cronjob, run through Alfred, etc.
#!/usr/bin/osascript
tell application "System Events"
tell process "NotificationCenter"
set vWindowCount to (count windows)
if vWindowCount is 0 then
return
end if
set vWindow to window 1
set vNotificationContainer to (UI element 1 of scroll area 1 of vWindow)
@bkyle
bkyle / unheader.py
Created October 10, 2023 12:56 — forked from omots/unheader.py
SNES unheadering tool
#!/usr/bin/env python3
# unheader.py - Portable commandline SNES ROM unheading tool
# By oldmanoftheSEA (omotss@twitter, omots@github)
# THIS UTILITY COMES WITH NO WARRANTY EXPRESSED OR IMPLIED
# Backups are ALWAYS a good idea.
# Principles & support:
# This tool is generally conservative when it comes to making modifications.