Skip to content

Instantly share code, notes, and snippets.

View 2shortplanks's full-sized avatar

Mark Fowler 2shortplanks

View GitHub Profile
@2shortplanks
2shortplanks / Screenshot.applescript
Created May 14, 2024 06:37
Capture an entire Slack Channel as screenshots
set epoch to do shell script "perl -e 'print ~~time'"
set dir to "/tmp/" & epoch
do shell script "mkdir " & dir
tell application "Slack" to activate
tell application "System Events"
set counter to 1
repeat 1000 times
delay 1
@2shortplanks
2shortplanks / transcribe
Last active January 25, 2024 21:19
script to transcripe anything with whisper
#!/bin/sh
# this script relies on a bunch of stuff
#
# 1. ffmpeg has been installed by brew
# 2. The instructions from https://blog.castopod.org/install-whisper-cpp-on-your-mac-in-5mn-and-transcribe-all-your-podcasts-for-free/
# have been followed to install whisper.cpp and the models. These are:
# cd ~/co
# git clone https://github.com/ggerganov/whisper.cpp.git
# cd whisper.cpp
@2shortplanks
2shortplanks / index.html
Last active January 20, 2021 12:31
TabTime
<!DOCTYPE html>
<head>
<style>
body { background: purple; font-family: Helvetica, sans-serif }
h1 { font-size: 100pt; font-size: 20vw; text-align: right}
h2 { font-size: min(3vw, 50px) }
p { font-size: min(2vw, 30px) }
#time { background: yellow; padding: 0.5vw }
.cyan { background: cyan; padding: 0.5vw }
@2shortplanks
2shortplanks / gist:1973e4651f17184520d3aa57a3e6e05f
Created November 16, 2020 21:19
Christmas Movies (from Wikipedia list) ranked by IMDb rating
SQLite version 3.11.0 2016-02-15 17:29:24
Enter ".help" for usage hints.
sqlite> SELECT name, rating
...> FROM wikipedia_films
...> JOIN imdb_films
...> USING (name, year)
...> ORDER BY rating DESC
...> LIMIT 100;
It's a Wonderful Life|8.6
Die Hard|8.2
#!/usr/bin/perl
# set the iterm background depending on what directory you're in.
# 1) put this file in you path.
# 2) put this in your .zshrc
# function chpwd() {
# change-terminal-background
# }
# 3) Create the directory ~/setup/whatever/bg
#!/usr/bin/perl
use strict;
use warnings;
use HTTP::Tiny;
use IPC::Run3 qw( run3 );
use JSON::PP qw( encode_json decode_json );
my $PROJECT_ID = ...; # The numbers at the end of your project URL
@2shortplanks
2shortplanks / gist:c058a17758d5e543e8cff477e7f5b36c
Created January 8, 2019 23:13
ojoJojo - monkey'd version of ojo
package ojoJojo;
use Mojo::Base -strict;
use ojo;
use Mojo::Util qw(monkey_patch);
use Mojo::JSON::Pointer;
use Scalar::Util qw( blessed );
sub import {
@2shortplanks
2shortplanks / Scrape.js
Created October 11, 2018 23:58
A scriptable script to work out what’s for lunch
const url = "http://www.rcscares.org/lunch-menu/"
try {
// ###########################################
// work out the name of the dow we want lunch for
// ###########################################
const days = [
"Monday",
@2shortplanks
2shortplanks / motd.pl
Created March 13, 2018 12:20
A script to scrape the school website and send me the motd the day - which is contained in a squarespace JSON data structure!
#!/usr/bin/perl
use strict;
use warnings;
use File::Spec::Functions qw(catfile);
use File::Basename qw(dirname);
use HTML::Strip ();
use JSON::PP qw(decode_json);
use LWP::UserAgent ();
@2shortplanks
2shortplanks / gist:6b851763a063cc6bc08047a5408387e2
Last active September 2, 2020 06:56
Configure Karabiner Elements to control itunes volume / pause itunes. Install Karabiner-Elements from https://github.com/tekezo/Karabiner-Elements. Download this gist and put in `~/.config/karabiner/assets/complex_modifications`, then go to "Complex Modifications" tab, press "+ Add Rule" and then click Enable next to the rules
{
"title" : "iTunes direct",
"rules" : [
{
"manipulators" : [
{
"from" : {
"modifiers" : {
"mandatory" : [
"fn",