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 / gist:95cc50404d1a6f2d38ae
Created July 22, 2015 05:29
HTTP::Tiny loggable
use strict;
use warnings;
use HTTP::Tiny;
{
my $ua = HTTP::Tiny->new();
my $request = '';
my $response = '';
@vti
vti / send-to-edge-500
Last active August 29, 2015 14:16
Reliably send GPX to Garmin EDGE 500
#!/bin/sh
#set -x
FILE=$1
DEV=$2
MOUNT=/tmp/garmin
FILE_BASENAME="${FILE%.gpx}"
FILE_DATES="$FILE_BASENAME-dates.gpx"
@vti
vti / Foo.pm6
Last active August 29, 2015 14:10
class Foo {
method foo () {
ROUTE: for ^1 {
}
}
}
@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>