Skip to content

Instantly share code, notes, and snippets.

Sylvain Colinet Skarsnik

Block or report user

Report or block Skarsnik

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
View gist:65af8fd9fd898ff6eb2a
sub get_bookshelf {
my $rep = $ua.get("$bbaseurl$bookid");
if ! $rep.is-success {
die "Can't contact $bbaseurl";
}
# first we need to know the number of page
my $xmldoc = parse-html($rep.content, :TAG<div>, :class<page_list>, :SINGLE, :nowhitespace);
my @pages = $xmldoc.elements(:TAG<li>, :RECURSE);
my $number_of_page;
View gist:2db25f0b9ab52dc0635b
use Config::Simple::Role;
class Config::Simple does Config::Simple::Role {
multi method new($filename) {
return self.bless(:filename($filename));
}
multi method new($filename, Str :$b) {
my $module = "Config::Simple::$b";
View testleak.p6
use Gumbo::Parser; # replace with HTML::Parser::XML
use XML;
my $parser = Gumbo::Parser.new;
my $html = qqx{wget -o /dev/null -O - https://www.fimfiction.net/bookshelf/149291/};
say "Getting/parsing a wegpage with a quite huge xml tree, prepare yourself some coffee if you use H:P:X";
say "webpage is "~$html.chars~" size.";
my $xml = $parser.parse($html);
View extractbookshelf.p6
use v6;
use lib './', '/root/testmodif/s/perl6-html-parser-xml/lib/';
use FicClass;
use Gumbo;
use StoryFactory;
use HTTP::UserAgent;
use HTTP::Cookie;
View article1.p6
use v6;
use Gumbo;
use XML;
use HTTP::UserAgent;
#We define some base url, notice that I don't use https
my $bbaseurl = "http://www.fimfiction.net/bookshelf/";
my $fimbaseurl = "http://www.fimfiction.net/";
View NC.sh
root@testperl6:~/piko/DBIish# perl6 -e 'use NativeCall; sub sqlite3_libversion_number() returns int32 is native("libsqlite3.so") is export { ... }; say sqlite3_libversion_number()'
3008007
root@testperl6:~/piko/DBIish# perl6 -e 'use NativeCall; sub sqlite3_libversion_number() returns Int is native("libsqlite3.so") is export { ... }; say sqlite3_libversion_number()'
895812289686267399
root@testperl6:~/piko/DBIish# uname -a
Linux testperl6 3.16.0-4-586 #1 Debian 3.16.7-ckt11-1+deb8u5 (2015-10-09) i686 GNU/Linux
View testleak.p6
use Gumbo::Parser; # replace with HTML::Parser::XML
use XML;
my $parser = Gumbo::Parser.new;
my $html = qqx{wget -o /dev/null -O - https://www.fimfiction.net/bookshelf/149291/};
say "Getting/parsing a wegpage with a quite huge xml tree, prepare yourself some coffee if you use H:P:X";
say "webpage is "~$html.chars~" size.";
my $xml = $parser.parse($html);
View alttp collision.lua
local camera_x
local camera_y
local link_x
local link_y
-- $0114
-- $6C[0x01] - Indicates whether you are standing in a doorway
View alttpshuffleinput.asm
lorom
; $04CB is free ram, let use 12x2 bytes for our changes
!TABLE_ICHANGE = $04CB
!CPY_ORIGINAL_INPUT = $7C
; $80-81 copy of input
!CPY_INPUT = $80
!ROOM_COUNTER = $2B2
View SoE timer.lua
local framestarted = 0
function savestateloaded()
framestarted = 0;
end
event.onloadstate(savestateloaded);
function to_rta(ftime)
local cpy = ftime
You can’t perform that action at this time.