Skip to content

Instantly share code, notes, and snippets.

Avatar

Pawel Pabian bbkr

View GitHub Profile
@bbkr
bbkr / log.txt
Created Aug 1, 2019
shield tv log
View log.txt
08-01 23:03:11.219 13836 14202 D Retrofit: --> GET https://gfnpc.api.entitlement-prod.nvidiagrid.net/v2/apps?languageCode=en_US&countryCode=PL&vpcId=NP-STH-01&serviceName=gfn_pc
08-01 23:03:11.677 13836 14202 D Retrofit: <-- 200 https://gfnpc.api.entitlement-prod.nvidiagrid.net/v2/apps?languageCode=en_US&countryCode=PL&vpcId=NP-STH-01&serviceName=gfn_pc (457ms, 184117-byte body)
08-01 23:03:11.699 13836 14202 W ContentProvider: Normalized content://com.nvidia.pgcontentprovider.PGContentProvider//default/gameinfo/1 to content://com.nvidia.pgcontentprovider.PGContentProvider/default/gameinfo/1 to avoid possible security issues
08-01 23:03:11.796 3688 3838 E WifiVendorHal: getWifiLinkLayerStats(l.937) failed {.code = ERROR_NOT_AVAILABLE, .description = }
08-01 23:03:12.006 13836 14202 D UnifiedAPIException: RequestException :: createException
08-01 23:03:12.007 13836 14202 E UnifiedAPIException: Throwing 403 exception
08-01 23:03:12.007 13836 14202 D UnifiedAPIException: RequestStatus: <?xml version="1.0" enco
@bbkr
bbkr / template_engines.p6
Last active Feb 28, 2017
Template engines
View template_engines.p6
use v6;
my $template = q{
Hi [VARIABLE person]!
You can change your password by visiting [VARIABLE link] .
Best regards.
};
View df.txt
$ df -k -P # use 1024 blocks and suppress inode stats
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/disk3 1219749248 341555644 877937604 29% /
devfs 343 343 0 100% /dev
/dev/disk1s4 133638140 101950628 31687512 77% /Volumes/Untitled
map -hosts 0 0 0 100% /net
map auto_home 0 0 0 100% /home
map -fstab 0 0 0 100% /Network/Servers
//Pawel%20Pabian@biala-skrzynka.local./Data 1951417392 1837064992 114352400 95% /Volumes/Data
/dev/disk5s2 1951081480 1836761848 114319632 95% /Volumes/Time Machine Backups
View Foo.pm
use NativeCall;
unit module Foo;
my sub f1 () is native('libwhatever') { * }
my sub f2 (int) is native('libwhatever') { * }
my sub f3 (int, int) is native('libwhatever') { * }
my sub f4 (int, int, int) is native('libwhatever') { * }
my sub f5 (int, int, int, int) is native('libwhatever') { * }
my sub f6 (int, int, int, int, int) is native('libwhatever') { * }
my sub f7 (int, int, int, int, int, int) is native('libwhatever') { * }
@bbkr
bbkr / foo.t
Created Sep 7, 2015
Running Perl 6 test from Perl 5
View foo.t
my $parser = TAP::Parser->new( { "exec" => [ 'perl6', $FindBin::Bin . '/api/' . $method . '.t' ] } );
while ( my $result = $parser->next ) {
next unless $result->is_test;
ok $result->is_ok, $result->description;
}
@bbkr
bbkr / README.txt
Last active Jan 19, 2019
Asynchronous junkie
View README.txt
I love Perl 6 asynchronous features. They are so easy to use and can give instant boost by changing few lines of code that I got addicted to them. I became asynchronous junkie. And finally overdosed. Here is my story...
I was processing a document that was divided into chapters, sub-chapters, sub-sub-chapters and so on. Parsed to data structure it looked like this:
my %document = (
'1' => {
'1.1' => 'Lorem ipsum',
'1.2' => {
'1.2.1' => 'Lorem ipsum',
'1.2.2' => 'Lorem ipsum'
@bbkr
bbkr / gist:4930c5bb9abaa2211756
Last active Sep 3, 2015
Curl Easy NativeCall
View gist:4930c5bb9abaa2211756
use NativeCall;
class Curl::Easy is repr( 'CPointer' ) {
sub curl_easy_init ( ) returns Curl::Easy is native( 'libcurl' ) { * };
sub curl_easy_cleanup ( Curl::Easy ) is native( 'libcurl' ) { * };
method new ( ) {
curl_easy_init();
}
@bbkr
bbkr / FelineHotel.pm
Last active Oct 13, 2015
JSON::RPC blogpost
View FelineHotel.pm
class FelineHotel;
has %!rooms =
403 => {
'type' => 'Standard',
'equipment' => [ 'bed', 'bowl' ],
'price' => 64,
'available' => True,
},
406 => {
@bbkr
bbkr / currency.p6
Created Jul 4, 2012 — forked from masak/currency.p6
Having fun with currencies in Perl 6
View currency.p6
enum Currency <EUR USD>;
multi rate(EUR) { 1.252 }
multi rate(USD) { 1.000 }
class Money {
has Real $.amount;
has Currency $.currency;
method convert_to(Currency $currency) {