Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ooobo on github.
  • I am ooobo (https://keybase.io/ooobo) on keybase.
  • I have a public key ASD5sDZQgm14GDNOAso_bCQtOk8WQXPVFNmGscBFCVHmoAo

To claim this, I am signing this object:

@ooobo
ooobo / bookmarklet.html
Last active June 22, 2019 08:00
tveeder + timestamps and live updating captions everywhere
<p><a href="javascript:location.href.match(%2Ftveeder%2F)%3F(%24(%22.caption%22).each(function(a)%7Ba%3D%24(this).attr(%22data-date%22)%3Ba%3D(new%20Date(1E3*a)).toLocaleString()%3B%24(this).attr(%22title%22%2Ca)%7D)%2C%24(%22%23caption-container%22).on(%22DOMNodeInserted%22%2C%22.caption%22%2Cfunction(a)%7Ba%3D%24(%22.caption%22).last()%3Bvar%20b%3Da.attr(%22data-date%22)%3Bb%3D(new%20Date(1E3*b)).toLocaleString()%3Ba.attr(%22title%22%2Cb)%7D)%2C%22undefined%22!%3Dtypeof%20x%3FDate.now()%2F1E3%3Cx.to%3F(console.log(%22program%20still%20airing%2C%20grab%20live%20captions%22)%2CgetCaptions())%3Aconsole.log(%22program%20finished%22)%3Aconsole.log(%22live%20already%2C%20do%20not%20trigger%20getCaptions%22))%3Awindow.location%3D%22http%3A%2F%2Ftveeder.com%22%3Bvoid+0">tveeder+</a></p>
<p>drag that link to your bookmarks bar, click it when to visit tveeder.com, then <b>click again</b> for timestamps on hover over captions, and updating captions on program pages accessed through the epg.</p>
@ooobo
ooobo / eject all disks.scpt
Created June 27, 2016 07:01
simply eject all the disks on macOS
-- first close music app, then eject disks.
try
tell application "Swinsian"
quit
end tell
tell application "Finder"
eject the disks
display notification "Ejected all disks"
end tell
on error
@ooobo
ooobo / assignEditUrls.gs
Last active June 24, 2020 12:59
put edit response urls for google form in linked spreadsheet
// install as a google script linked to the form, not the spreadsheet. must add a trigger to run assignEditUrls() on form submit.
// benefit of linking to the form is that copying the spreadsheet will copy the spreadsheet, form and script.
function assignEditUrls() {
var form = FormApp.getActiveForm();
var ss = SpreadsheetApp.openById(form.getDestinationId());
var sheet = ss.getSheets()[0];
var data = sheet.getDataRange().getValues();
var urlCol = 2; // column number where URL's should be populated; A = 1, B = 2 etc
var responses = form.getResponses();
@ooobo
ooobo / export swinsian selected.scpt
Last active August 14, 2023 04:01
AppleScript: export songs from Swinsian playlist and rename as numbered files
-- great for exporting a playlist from Swinsian to another music playing software, while keeping the order of the playlist.
-- to install: open Script Editor.app, paste this, go File > Export, choose File Format: application, save anywhere you like.
-- to use: select tracks to export in Swinsian, then run the app you just saved.
-- note: doesn't handle those files already existing in selected folder. pads for two-digits, adds artist - title.ext
set theFolder to choose folder
set text item delimiters to "."
tell application "Swinsian"
set selected to selection of window 1
-- check that the playlist is not empty
@ooobo
ooobo / events-conditional-wrappers.php
Created June 23, 2012 07:48 — forked from jo-snips/events-conditional-wrappers.php
The Events Calendar: Basic Conditional Wrappers
add_action( 'wp_print_styles', 'deregister_styles', 100 );
function deregister_styles() {
if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page
} elseif( tribe_is_month() && is_tax() ) { // Calendar Category Pages
} elseif( tribe_is_event() && !tribe_is_day() && !is_single() ) { // The Main Events List
} elseif( tribe_is_event() && is_single() ) { // Single Events