Skip to content

Instantly share code, notes, and snippets.

Mark Fowler 2shortplanks

Block or report user

Report or block 2shortplanks

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pt-of-sync.pl
#!/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
View gist:c058a17758d5e543e8cff477e7f5b36c
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 Oct 11, 2018
A scriptable script to work out what’s for lunch
View Scrape.js
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 Mar 13, 2018
A script to scrape the school website and send me the motd the day - which is contained in a squarespace JSON data structure!
View motd.pl
#!/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 Jan 10, 2019
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
View gist:6b851763a063cc6bc08047a5408387e2
{
"title" : "iTunes direct",
"rules" : [
{
"manipulators" : [
{
"from" : {
"modifiers" : {
"mandatory" : [
"fn",
View meetingwall.txt
Meetingwall
===========
Today is gonna be the day
That they're gonna throw it back to you
By now you should've somehow
Realized what you gotta do
I don't believe that anybody
Feels the way I do, about this now
View gist:32aa0894593d84499fb01833293b7846
This file has been truncated, but you can view the full file.
{"version":"0.3.2","level":"debug","message":"app is ready","timestamp":"2017-01-12T21:07:16.209Z"}
{"hotkey":"alt+space","level":"verbose","message":"registering zazu hotkey","timestamp":"2017-01-12T21:07:16.255Z"}
{"level":"info","message":"Adding to win32 or darwin startup","timestamp":"2017-01-12T21:07:16.452Z"}
{"level":"verbose","message":"git clone [tinytacoteam/zazu-light-theme] has 3 attempts","timestamp":"2017-01-12T21:07:19.225Z"}
{"level":"verbose","message":"git clone [tinytacoteam/zazu-light-theme] success","timestamp":"2017-01-12T21:07:20.071Z"}
{"plugin":"tinytacoteam/zazu-light-theme","level":"verbose","message":"loading package: tinytacoteam/zazu-light-theme","timestamp":"2017-01-12T21:07:20.072Z"}
{"plugin":"tinytacoteam/zazu-light-theme","level":"info","message":"loading css for theme","timestamp":"2017-01-12T21:07:20.078Z"}
{"level":"verbose","message":"git clone [tinytacoteam/zazu-calculator] has 3 attempts","timestamp":"2017-01-12T21:07:20.094Z"}
View gist:a29738c28e2df87d1d787b789322469a
Mark@travis:~/co/Test2-Harness-Renderer-TeamCity$ cat t/test-data/basic/simple-fail/input.st
use strict;
use warnings;
use Test::More;
ok 0, 'simple-fail-msg';
done_testing;
Mark@travis:~/co/Test2-Harness-Renderer-TeamCity$ cat TeamCitySerial t/test-data/basic/simple-fail/expected.txt
View gist:e3afc93469429e7eb61da9ee2bfa26c0
Mark@travis:/tmp$ perl foo.t
# Seeded srand with seed '20170104' from local date.
ok 1 - arse
1..1
Mark@travis:/tmp$ T2_FORMATTER=EventStream perl foo.t
T2_FORMATTER: EventStream
T2_EVENT: {"message":"Seeded srand with seed '20170104' from local date.","__PACKAGE__":"Test2::Event::Note","trace":{"__PACKAGE__":"Test2::Util::Trace","frame":["Test2::Plugin::SRand","/opt/markperl/lib/site_perl/5.22.0/Test2/Plugin/SRand.pm","59","SRAND"],"tid":0,"pid":92868}}
T2_ENCODING: utf8
T2_EVENT: {"effective_pass":1,"pass":1,"__PACKAGE__":"Test2::Event::Ok","trace":{"frame":["main","foo.t",5,"Test2::Tools::Basic::ok"],"__PACKAGE__":"Test2::Util::Trace","tid":0,"pid":92868},"name":"arse"}
T2_EVENT: {"max":1,"__PACKAGE__":"Test2::Event::Plan","trace":{"tid":0,"pid":92868,"frame":["main","foo.t",6,"Test2::Tools::Basic::done_testing"],"__PACKAGE__":"Test2::Util::Trace"},"directive":""}
@2shortplanks
2shortplanks / Wishlist2.md
Created Jun 9, 2016
A list of OS X / tvOS / watchOS / other wishes for WWDC
View Wishlist2.md

OS X

  • Bandwidth management
    • Have a low bandwidth mode
    • only apps that opt into the low bandwidth API are allowed internet access
    • such apps receive notifications of entering low bandwidth mode and would have to request access before being able to use internet
    • would allow Dropbox to, say, learn of new updates and create share links but not download files
  • DnD
    • option to prompt with a single notification each hour to question if DnD should be turned off
You can’t perform that action at this time.