This file contains hidden or 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
#!/Users/brian/bin/perls/perl5.22.0 | |
use v5.22; | |
use feature qw(signatures); | |
no warnings qw(experimental::signatures); | |
package Tie::Scalar::Sub { | |
use parent qw(Tie::Scalar); | |
use Carp qw(croak); |
This file contains hidden or 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
#!perl | |
use strict; | |
use warnings; | |
=pod | |
Match 8.3 filenames in the DOS way, from Raymond Chen | |
https://blogs.msdn.microsoft.com/oldnewthing/20071217-00/?p=24143 |
This file contains hidden or 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
websocket '/find' => sub ( $c ) { | |
state $loop = Mojo::IOLoop->singleton; | |
app->log->debug( "websocket for find" ); | |
$c->inactivity_timeout( 50 ); | |
my $id; | |
$c->on( message => sub ( $ws, $message ) { | |
my $json = decode_json( $message ); | |
my $command = $json->{c}; |
This file contains hidden or 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
#!/Users/brian/Dropbox/perl6s/rakudo-star-2016.10/bin/perl6 | |
use v6; | |
# https://docs.perl6.org/language/unicode_texas#Other_acceptable_single_codepoints | |
# https://gist.github.com/briandfoy/619638701f38817387f3e5d22d6dab12 | |
my %hash; | |
BEGIN { # Phasers on! |
This file contains hidden or 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
#!/Users/brian/bin/perls/perl5.24.0 | |
use v5.24; | |
use feature qw(signatures); | |
no warnings qw(experimental::signatures); | |
use Data::Dumper; | |
use HTML::Entities; | |
use Mojo::UserAgent; | |
use open qw(:std :utf8); |
This file contains hidden or 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
#!/Applications/Rakudo/bin/perl6 | |
# http://www.decisionsciencenews.com/2017/06/19/counterintuitive-problem-everyone-room-keeps-giving-dollars-random-others-youll-never-guess-happens-next/ | |
multi MAIN ( Int $players = 100, Int $dollars = 100, Int $max-rounds = 5000 ) { | |
my @array = { | |
wallet => $dollars, # the current money N has | |
received => 0, # the cumulative money received | |
'given' => 0, # the cumulative money given | |
} xx $players; | |
my &recipient = &donate-to.assuming( @array.elems ); |
This file contains hidden or 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
#!/Applications/Rakudo/bin/perl6 | |
my $ranks = ( 2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K', 'A' ); | |
my $suits = < ♣ ♡ ♠ ♢ >; | |
( @$ranks X @$suits ) | |
==> map { [~] @$_ } \ | |
==> my @cards; | |
; |
This file contains hidden or 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
by brian d foy <[email protected]> | |
Klint Finley's article for <i>Wired<i>, <a href="https://www.wired.com/story/giving-open-source-projects-life-after-a-developers-death/">Giving Open-Source Projects Life After A Developer's Death</A>, discusses the trouble taking over Ruby projects when the lead developer dies. He interviewed Neil Bowers, one of the people who helps maintain the Comprehensive Perl Archive Network then mangles the information to make it seem like the Neil by himself sometimes finds volunteers to take over projects if he feels like it at the time. | |
But the PAUSE (Perl Authors Upload Server) admins do much more than that. We've had an official policy around it for years. I remember the first time we had to deal with this. Over a decade ago <a href="http://archive.oreilly.com/pub/post/perl_loses_contributor_and_col.html">Iain Truskett, an important Perl developer, passed away</a>. Andy Lester took it upon himself to act as a executor of the developer's CPAN packages. He didn't want to mai |
This file contains hidden or 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
#!/Applications/Rakudo/bin/perl6 | |
use Test; | |
multi infix:<↑> ( Int:D \n, Int:D \m --> Int:D ) | |
is equiv(&infix:<**>) | |
is assoc<right> | |
{ n ** m } | |
proto infix:<↑↑> ( Int:D \n, Int:D \m --> Int:D ) |
This file contains hidden or 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
=pod | |
I'm experiencing an odd problem on macOS 10.13. I suspect it's | |
something to do with APFS (Encrypted). It looks like there's some | |
other magic when I try to rename a file to a name that already exists. | |
I could not reproduce this on FAT or HFS+ filesystems. | |
I've tried this with perls back to 5.12, all compiled with clang | |
(4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)). |