Skip to content

Instantly share code, notes, and snippets.

View kwakwaversal's full-sized avatar

Paul Williams kwakwaversal

View GitHub Profile
@kwakwaversal
kwakwaversal / URLQueue.pl
Last active September 18, 2017 14:30 — forked from jberger/URLQueue.pl
Modularization of my answer from SO on URL queuing for non-blocking ua #mojo #perl
#!/usr/bin/env perl
package Mojo::URLQueue;
use Mojo::Base 'Mojo::EventEmitter';
use Mojo::UserAgent;
has queue => sub { [] };
has ua => sub { Mojo::UserAgent->new(max_redirects => 5) };
has concurrency => 4;
@kwakwaversal
kwakwaversal / install-guest-additions.sh
Last active July 23, 2018 21:04 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions for debian/jessie64 with vagrant #shell
# Start a vagrant without virtualbox guest additions
$ vagrant init debian/jessie64
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@kwakwaversal
kwakwaversal / perl-stubbing-ua.pl
Last active September 18, 2017 14:33
How to stub Mojo::UserAgent the right way #mojo #perl
package main;
use Mojo::Base -strict;
use Test::More;
use Mojo::UserAgent;
use Mojo::Transaction;
# preparing... monkey patch is a good style
no warnings 'redefine';
local *Mojo::UserAgent::get = sub {
my $tx = Mojo::Transaction->new;
@kwakwaversal
kwakwaversal / 0_reuse_code.js
Last active September 19, 2017 13:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Exporting code to Git and tiding up its history

Author: Tiago Alves Macambira [tmacam burocarata org]
Licence:Creative Commons By-SA
@kwakwaversal
kwakwaversal / spike-oauth2
Last active September 18, 2017 14:26 — forked from zakame/spike-oauth2
#mojo #perl
#!/usr/bin/env perl
use Mojolicious::Lite;
plugin 'OAuth2',
google => {
key => $ENV{GOOGLE_OAUTH2_CLIENT_ID},
secret => $ENV{GOOGLE_OAUTH2_CLIENT_SECRET},
};
my $service = 'https://www.googleapis.com';
#!/usr/bin/env perl
use Modern::Perl;
use DBI;
use DBD::Pg qw(:async);
use Coro;
use AnyEvent;
use Time::HiRes qw(time);
@kwakwaversal
kwakwaversal / multiple_ssh_setting.md
Last active September 18, 2017 14:24 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH Keys settings for different github account #shell

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"