Skip to content

Instantly share code, notes, and snippets.

View lancew's full-sized avatar

Lance Wicks lancew

View GitHub Profile
@lancew
lancew / temp.css
Last active February 13, 2025 17:18
/* project: internet market
design: luka cvrk (www.solucija.com)
framework: Concept Nova (www.conceptnova.com) */
body { padding: 0; margin: 0; font: 0.7em Arial, sans-serif; line-height: 1.5em; background: #F0F0F0; color: #454545; }
a { color: #0E4D8B; background: inherit; }
a:hover { color: #000; background: inherit;}
a.title { color: #B41A1A; background: #FFF; }
h1 { font: bold 2em Arial, Sans-Serif; letter-spacing: -1px; padding: 16px 0 0 8px; margin: 0; }

Code Layout

  1. Brace and parenthesize in K&R style.
  2. Separate your control keywords from the following opening bracket.
  3. Don’t separate subroutine or variable names from the following opening bracket.
  4. Don’t use unnecessary parentheses for builtins and ‘honorary’ builtins.
  5. Separate complex keys or indices from their surrounding brackets.
  6. Use whitespace to help binary operators stand out from their
@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