Skip to content

Instantly share code, notes, and snippets.

View vti's full-sized avatar

Viacheslav Tykhanovskyi vti

  • UPTOSMTH OÜ
  • Mars
View GitHub Profile
@vti
vti / howto.md
Last active October 7, 2022 05:54
How to run Freedom on Wahoo Bolt
  1. Figure out WM dimensions
    • adb shell wm size
  2. Install APK from https://github.com/mkrupczak3/Freedoom-for-Android/releases/tag/v0.4.3
    • adb install /path/to/apk
  3. Grant file usage permissions
    • adb shell pm grant net.nullsum.freedoom android.permission.WRITE_EXTERNAL_STORAGE
    • adb shell pm grant net.nullsum.freedoom android.permission.READ_EXTERNAL_STORAGE
  4. Start the application (how to find the activity "dumpsys package | grep doom")
    • adb shell am start -n net.nullsum.freedoom/.EntryActivity
  5. Tap on different places (the easiest way is to make a screenshot and locate x/y)
@vti
vti / example.pm
Created July 29, 2018 04:52
Custom oop bundle
package MyClass;
use oop -class => 1, -types => [qw/Int/];
has 'foo', is => 'ro', is => Int, required => 1;
package MyRole;
use oop -role => 1;
requires 'foo';
Building Encode-2.92
cp lib/Encode/MIME/Header/ISO_2022_JP.pm blib/lib/Encode/MIME/Header/ISO_2022_JP.pm
cp lib/Encode/Unicode/UTF7.pm blib/lib/Encode/Unicode/UTF7.pm
cp lib/Encode/Config.pm blib/lib/Encode/Config.pm
cp Encode/ConfigLocal_PM.e2x blib/lib/Encode/ConfigLocal_PM.e2x
cp lib/Encode/MIME/Header.pm blib/lib/Encode/MIME/Header.pm
cp Encode/_T.e2x blib/lib/Encode/_T.e2x
cp lib/Encode/Alias.pm blib/lib/Encode/Alias.pm
cp lib/Encode/MIME/Name.pm blib/lib/Encode/MIME/Name.pm
cp Encode.pm blib/lib/Encode.pm
@vti
vti / books.pl
Created July 4, 2012 16:00
Books publications
#!/usr/bin/env perl
use strict;
use warnings;
use URI;
use URI::Escape;
use Digest::SHA qw(hmac_sha256_base64);
use LWP::UserAgent;
use XML::LibXML;
@vti
vti / export_comments_to_disqus.pl
Created October 21, 2011 06:54
Export your Bootylicious comments to Disqus
#!/usr/bin/env perl
use strict;
use warnings;
my ($base_url, $articles_dir) = @ARGV;
$base_url && $articles_dir or die "Usage: $0 <base_url> <articles_directory>";
opendir(my $dh, $articles_dir) || die "can't opendir $articles_dir: $!";
diff --git a/lib/MetaCPAN/Role/JSONP.pm b/lib/MetaCPAN/Role/JSONP.pm
new file mode 100644
index 0000000..7dfcb37
--- /dev/null
+++ b/lib/MetaCPAN/Role/JSONP.pm
@@ -0,0 +1,42 @@
+package MetaCPAN::Role::JSONP;
+use Moose::Role;
+use Encode;
+
cpan t/var/tmp/fakecpan
<model CPAN>
servers :9900
</model CPAN>
<model User>
servers :9900
</model User>
% prove -l t/
t/fakecpan.t .. 2/? Can't call method "rmtree" on an undefined value at t/fakecpan.t line 33.
# Tests were run but no plan was declared and done_testing() was not seen.
t/fakecpan.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
All 2 subtests passed
t/types.t ..... ok
t/util.t ...... ok
@vti
vti / gist:1187191
Created September 1, 2011 20:31
metacpan jsonp via roles
diff --git a/lib/MetaCPAN/Role/JSONP.pm b/lib/MetaCPAN/Role/JSONP.pm
new file mode 100644
index 0000000..61b1ab6
--- /dev/null
+++ b/lib/MetaCPAN/Role/JSONP.pm
@@ -0,0 +1,37 @@
+package MetaCPAN::Role::JSONP;
+use Moose::Role;
+use Encode;
+
@vti
vti / gist:1186895
Created September 1, 2011 18:37
metacpan jsonp
diff --git a/lib/MetaCPAN/Server.pm b/lib/MetaCPAN/Server.pm
index 75f687d..2f0d103 100755
--- a/lib/MetaCPAN/Server.pm
+++ b/lib/MetaCPAN/Server.pm
@@ -1,9 +1,10 @@
package MetaCPAN::Server;
+use lib 'lib';
use Moose;
extends 'Catalyst';