This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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'}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |