Skip to content

Instantly share code, notes, and snippets.

Ricky Morse remorse

  • MGH Biostatistics Center
  • Boston, MA
Block or report user

Report or block remorse

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
@remorse
remorse / toggle_grayscale.pl6
Last active Apr 15, 2019
Perl 6 to toggle greyscale on macOS
View toggle_grayscale.pl6
#!/usr/bin/env perl6
# see <https://indiestack.com/2019/04/toggle-system-grayscale-mode/> for the background on this.
use v6;
use NativeCall;
sub UALib { "/System/Library/PrivateFrameworks/UniversalAccess.framework/UniversalAccess" }
sub UAGrayscaleIsEnabled returns int32 is native(&UALib) { * }
sub UAGrayscaleSetEnabled (int32 $status) is native(&UALib) { * }
UAGrayscaleSetEnabled(UAGrayscaleIsEnabled() == 0);
@remorse
remorse / gist:8db4a635e58f526a7ef43716a3b68964
Last active Mar 9, 2017
New version of download tumblr posts
View gist:8db4a635e58f526a7ef43716a3b68964
#!/usr/bin/env perl6
use v6;
sub croak ($msg) { note $msg; exit(1); } # because Perl 6 doesn't have the Perl 5 "\n" magic for die
# retrieve network data
use HTTP::UserAgent;
use JSON::Tiny;
# template
use Template::Mustache;
View gist:7fbfd973dc828268a077f9258ea192dc
#!/usr/bin/env perl6
use v6;
sub croak ($msg) { note $msg; exit(1); } # because Perl 6 doesn't have the Perl 5 "\n" magic for die
# retrieve network data
use HTTP::UserAgent;
use JSON::Tiny;
# template
use Template::Mustache;
View gist:f59c149c52b805874cb473bf4a39b6ac
#!/usr/bin/env perl6
my %p = (:date-gmt("XXX"), :id("XXX"), :slug("XXX"), :tags($["Galaxy", "Galaxy fan render", "planet"]), :type("photo"), :url("http://XXX"), :url-with-slug("http://XXX"));
my %post = (
'_post' => %p,
'_type' => %p{'type'},
'post_id' => %p{'id'},
'post_slug' => %p{'slug'} || %p{'type'},
@remorse
remorse / create_printable_xkcd.pl6
Created Oct 12, 2016
Create a printable nice version of XKCD comics
View create_printable_xkcd.pl6
#!/usr/bin/env perl6
use v6;
use LWP::Simple;
use JSON::Tiny;
use Template::Anti;
my $outdir = '/Users/rem16/Pictures/comics/';
my $comic = '1053';
# get the JSON info
You can’t perform that action at this time.