Skip to content

Instantly share code, notes, and snippets.

Avatar

Chase Nordengren semicolonsnet

View GitHub Profile
@semicolonsnet
semicolonsnet / Background Music.applescript
Created Nov 30, 2020
A quick-and-easy AppleScript to 1) loop a background music file, and 2) fade that file out when a dialog button is pressed. I use this when presenting slide decks virtually.
View Background Music.applescript
tell application "QuickTime Player"
set theFile to open POSIX file "FILENAME HERE"
set audio volume of theFile to 0.3
set looping of theFile to true
play theFile
end tell
display dialog "Music Control" buttons {"Fade"}
tell application "QuickTime Player"
@semicolonsnet
semicolonsnet / Shairport-buttons.py
Last active Nov 24, 2020
Python script for pHAT BEAT buttons to control device connected by Shairport-sync via DBUS. See Shairport-sync for instructions on enabling DBUS.
View Shairport-buttons.py
#!/usr/bin/env python
import signal
import os
import phatbeat
print("""
pHAT BEAT: Shairport Buttons
@semicolonsnet
semicolonsnet / Latin Ligature Find and Replace.csr
Last active Nov 9, 2020
Calibre file to assist with broken ligatures. If ligatures are showing up with strange characters (like √ for ff), this find-and-replace set will replace all Latin ligatures with their letter equivalents. Use by checking "Keep Ligatures" and loading this list under the Find and Replace tab in Calibre options.
@semicolonsnet
semicolonsnet / TestMD.md
Created Jun 10, 2019
A document for testing Markdown stylesheets that includes all the basic Markdown elements
View TestMD.md

Markdown Test

Why are you closed? Tell us why you're closed. Tell us why you're closed. Why, why, why are you closed? I want to go shopping in the East Centre.

Why are you -- why are you closing your doors? Why are you locking your doors to the public? Why? Tell us the reason, why? Why? Why?

Heading 2

Tell us the reason.

@semicolonsnet
semicolonsnet / network-data-conversion.r
Created May 9, 2019
Various functions for converting social network data into different formats in R
View network-data-conversion.r
csvtomatrix <- function (Y) {
# Converts CSV into data matrix
Y.m<-data.matrix(Y)
Y.m<-Y.m[,-1]
dimnames(Y.m) <- list (Y[,1],Y[,1])
diag(Y.m)<-NA
# Returns data matrix
Y.m
}
@semicolonsnet
semicolonsnet / Export All Skim.scpt
Created Mar 14, 2019
AppleScript to output notes from all PDFs in a directory as "Notes as Markdown", using my template for the Skim PDF editor.
View Export All Skim.scpt
set this_folder to ""
set export_folder to ""
set these_files to every file of folder this_folder whose name extension is "pdf"
end tell
repeat with i from 1 to the count of these_files
set this_file to (item i of these_files as alias)
set fileName to name of item i of these_files
set savePath to export_folder & ":" & fileName & ".md"
tell application "Skim"
open this_file
@semicolonsnet
semicolonsnet / Make List.applescript
Created May 29, 2015
Makes a Reminders list from a text file template (each line is a new task)
View Make List.applescript
tell application "System Events"
set QueueList to display dialog "List Name" default answer ""
set listName to text returned of result
tell application "Reminders"
set myList to make new list
set name of myList to listName
set myFile to "FILE NAME HERE"
set myText to read myFile
set theList to paragraphs of myText
You can’t perform that action at this time.