Skip to content

Instantly share code, notes, and snippets.

View lancew's full-sized avatar

Lance Wicks lancew

View GitHub Profile
@lancew
lancew / gist:1b750e81b83963977858ea15dc54b765
Last active October 12, 2019 17:03
Per5->Perl6... next step Raku
sub MAIN($n=100) {
my $percentleft = 100;
my $biggestpercent = 0;
my $guestwithbiggestpercent = 0;
for (1..$n) -> $i
{
my $pi = $i * $percentleft / 100; # amount for guest i
print "guest $i has $pi percent of the pie\n";
if ( $pi > $biggestpercent )
@lancew
lancew / me
Created December 21, 2018 12:33
me
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXmxqcYARmhFDdnOkENqAdntZFprD2MZQ2orb7aNXRL2YYp8Ig7j8HmcMxJBsdFdsI+hKPja+6UTjO4gsLgNx7dW9/diL+nhGjEkvjnwbmDFmpbl0c4xvH48kHoGDF3PX64+2fq+nl74238VaKg7yuDnIDzU54y2fZtsRsaG5uxUjOxsIky0XsfL6tIN/SIjzCPpgw4/AQzgQAmB3FndBYbiRiqitbDLzsDHqR6TwOhqjsRrGaLHGtNt8mQzIAH+G0rhdcG6k7uZWcH3WF+p6Ydqkb6pvc78Gk0eQi692Ro9p1ulWgMsLHaKrpy8+t5RTNT1hNA+9N8xXWaCCnYgNR lancew@spectre
@lancew
lancew / gist:35afaad22c4a2d12385498590de33183
Created October 3, 2018 08:33
Perkeep in progress twitter change
[lancew@spectre perkeep.org]$ git diff
diff --git a/pkg/importer/twitter/twitter.go b/pkg/importer/twitter/twitter.go
index b1749504..905fc504 100644
--- a/pkg/importer/twitter/twitter.go
+++ b/pkg/importer/twitter/twitter.go
@@ -44,6 +44,7 @@ import (
"perkeep.org/pkg/schema/nodeattr"
"github.com/garyburd/go-oauth/oauth"
+ "github.com/gernest/mention"
@lancew
lancew / gist:c13be2ce9c9c3819b3adeae18faa940a
Last active September 26, 2018 17:55
Perkeep config experiementation
After:
"/bs/": {
"handler": "storage-proxycache",
"handlerArgs": {
"origin": "/sto-s3/",
"cache": "/cache/"
}
},
Before:
# perl6 bin/app.pl6
Entering the dance floor: http://0.0.0.0:80
Could not receive data from socket: Connection reset by peer
in method run at /opt/rakudo/share/perl6/site/sources/100A1B43D02574570A9FA5343A0679EF35FBD229 (HTTP::Easy) line 55
in method run at /opt/rakudo/share/perl6/site/sources/218D0B715DAF4AB75CD0D313EB14095B83F75935 (Bailador::Command::easy) line 19
in method baile at /opt/rakudo/share/perl6/site/sources/0807462282EC1C7304419CE7CFC18A16341291C4 (Bailador::App) line 280
in method baile at /opt/rakudo/share/perl6/site/sources/0807462282EC1C7304419CE7CFC18A16341291C4 (Bailador::App) line 265
in sub baile at /opt/rakudo/share/perl6/site/sources/6F33C03589936F3E254B5C14BC95945C77196A75 (Bailador) line 157
in block <unit> at bin/app.pl6 line 181
C:\Users\akage>zef install Bailador
===> Searching for: Bailador
No such method 'subst' for invocant of type 'Any'
in method ver at C:\rakudo\share\perl6\site\sources\8C459CF2854824E080AE9C6535800798F2F63839 (Zef::Distribution) line 127
in method hash at C:\rakudo\share\perl6\site\sources\8C459CF2854824E080AE9C6535800798F2F63839 (Zef::Distribution) line 21
in method hash at C:\rakudo\share\perl6\site\sources\8C459CF2854824E080AE9C6535800798F2F63839 (Zef::Distribution) line 114
in code at C:\rakudo\share\perl6\site\sources\8C459CF2854824E080AE9C6535800798F2F63839 (Zef::Distribution) line 93
in method provides-spec-matcher at C:\rakudo\share\perl6\site\sources\8C459CF2854824E080AE9C6535800798F2F63839 (Zef::Distribution) line 104
in method contains-spec at C:\rakudo\share\perl6\site\sources\8C459CF2854824E080AE9C6535800798F2F63839 (Zef::Distribution) line 109
rakudobrew build moar
bfee5a1ed5374fbb1d808ca834345eecb8726caf
HEAD is now at bfee5a1... Bump NQP to bring heap analyzer API changes
ATTENTION: no --prefix supplied, building and installing to /root/.rakudobrew/moar-nom/install
Using /root/.rakudobrew/moar-nom/install/bin/nqp-m (version 2017.08-47-g79e6453 / MoarVM 2017.08.1-128-gde6dced).
Cleaning up ...
/root/.rakudobrew/moar-nom/install/bin/nqp-m tools/build/gen-cat.nqp moar src/vm/moar/ModuleLoaderVMConfig.nqp src/Perl6/ModuleLoader.nqp > gen/moar/ModuleLoader.nqp
/root/.rakudobrew/moar-nom/install/bin/nqp-m --module-path=blib --target=mbc --output=blib/Perl6/ModuleLoader.moarvm --encoding=utf8 \
gen/moar/ModuleLoader.nqp
gcc -c -fPIC -Werror=declaration-after-statement -Werror=pointer-arith -O3 -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -fPIC -Werror=declaration-after-statement -Werror=pointer-arith -O3 -DNDEBUG -I/root/.rakudobrew/moar-nom/install/include/libatomic_ops \
$ zef install NativeHelpers::Blob
===> Searching for: NativeHelpers::Blob
===> Testing: NativeHelpers::Blob:ver('0.1.10'):auth('github:salortiz')
Type check failed for return value; expected NativeCall::Types::Pointer but got Whatever (*)
in sub memcpy at /home/lancew/.zef/store/NativeHelpers-Blob.git/274b8939c9eca486e07c5fea38eb90d23f9fc9f4/lib/NativeHelpers/Blob.pm6 (NativeHelpers::Blob) line 94
in sub blob-from-pointer at /home/lancew/.zef/store/NativeHelpers-Blob.git/274b8939c9eca486e07c5fea38eb90d23f9fc9f4/lib/NativeHelpers/Blob.pm6 (NativeHelpers::Blob) line 107
in sub blob-from-carray at /home/lancew/.zef/store/NativeHelpers-Blob.git/274b8939c9eca486e07c5fea38eb90d23f9fc9f4/lib/NativeHelpers/Blob.pm6 (NativeHelpers::Blob) line 121
in block <unit> at t/01-basic.t line 40
# Looks like you planned 24 tests, but ran 16

Keybase proof

I hereby claim:

  • I am lancew on github.
  • I am lancew (https://keybase.io/lancew) on keybase.
  • I have a public key whose fingerprint is 502F 9C8C C8A8 4096 9FA0 06CF 0963 4815 BACB 6DB2

To claim this, I am signing this object:

@lancew
lancew / gist:8516a908e963c5b4c25f
Created August 15, 2014 18:33
perl-ppi packer fail
$ packer -S perl-ppi
Aur Targets (1): perl-ppi
Proceed with installation? [Y/n]
Edit perl-ppi PKGBUILD with $EDITOR? [Y/n] n
==> Making package: perl-ppi 1.215-1 (Fri Aug 15 19:31:55 BST 2014)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...