This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use Modern::Perl; | |
use Mojo::UserAgent; | |
# Add list of URLs into @urls array | |
my @urls = qw(); | |
my $ua = Mojo::UserAgent->new; | |
for my $u (@urls) { | |
$u =~ s!^http://!!; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use Modern::Perl; | |
use Mojo::UserAgent; | |
use Mojo::JSON qw(decode_json); | |
use Excel::Writer::XLSX; | |
use Data::Dumper; | |
my $in_file = 'bhm.txt'; | |
my $output = 'bhm.xlsx'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const util = require('util'); | |
var url = 'http://localhost:3000/test'; // should be set over cli | |
const chrome = require('chrome-remote-interface'); | |
function onPageLoad(Runtime) { | |
const href = "document.querySelectorAll('a')"; | |
return Runtime.evaluate({ | |
expression: href |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A simple example of Google Analytics batched user permissions.""" | |
"""https://developers.google.com/analytics/devguides/config/mgmt/v3/user-management#batching""" | |
import argparse | |
from apiclient.discovery import build | |
from oauth2client.service_account import ServiceAccountCredentials | |
import httplib2 | |
from oauth2client import client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const puppeteer = require('puppeteer'); | |
// Test scenarios | |
// 4 different entrypoints | |
// ~8 different cookie setting scenarios (ie every page has at least 1 video) | |
// 2 different pre-set options - cookies and cookie-less | |
const reqUrls = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# To run need listen two ports: 80, 443 | |
# sudo morbo 12.pl -l https://*:443?cert%3D%2Fhome%2Flogioniz%2Fcert%2Fserver.crt%26key%3D%2Fhome%2Flogioniz%2Fcert%2Fserver.key%26verify%3D0x00 -l http://*:80 | |
# go to url in browser http://your_ip/qwe/asd | |
use Mojo::Base -strict; | |
use Mojolicious::Lite; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
use DateTime; | |
use FindBin qw($Bin); | |
use Getopt::Long; | |
use Modern::Perl; | |
use Mojo::JSON qw(encode_json); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Modern::Perl; | |
use DateTime; | |
my $past = DateTime->now->subtract(months => 6); | |
my $past_year = $past->year(); | |
my $past_month = $past->month(); | |
my $past_2_year = $past->subtract(years => 1)->format_cldr('yy'); | |
my $y_str; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub float2rat { | |
my $x = shift; | |
my $tolerance = 1.0E-6; | |
my $h1 = 1; | |
my $h2 = 0; | |
my $k1 = 0; | |
my $k2 = 1; | |
my $b = $x; | |
do { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Modern::Perl; | |
use Mojo::UserAgent; | |
use Mojo::JSON qw(decode_json); | |
use Image::Size qw(imgsize); | |
use POSIX; | |
my $urls = [...]; |