This file contains 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
// These may take a bit to run, depending on how much you have, | |
// but you should be done by morning if you leave it over night with the right configuration | |
// Open Twitter profile likes page | |
// Copy paste the minified jquery straight into the console | |
// Adjust the interval and count as you wish | |
var count = 1; | |
var interval = setInterval( clearLikes, 600 ); | |
function clearLikes() { | |
count++; |
This file contains 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
package Dancer2::Plugin::With; | |
use strict; | |
use warnings; | |
use Dancer2::Plugin; | |
plugin_keywords( qw< add_with route_with > ); | |
has 'with_reg' => ( | |
'is' => 'ro', |
This file contains 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 Dancer2; | |
use Text::CSV_XS qw< csv >; | |
use Path::Tiny qw< path >; | |
use JSON::MaybeXS qw< encode_json >; | |
# Create a CSV parser | |
my $csv = Text::CSV_XS->new({ | |
'binary' => 1, | |
'auto_diag' => 1, | |
}); |
This file contains 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
.--------------------. | |
.---------| Dancer2::Core::App |-----------.------------. | |
| '--------------------' | | | |
| | | v | |
v | | .-----------------. | |
.--------------. | | | D2::C::Response | | |
| routes | | | '-----------------' | |
|--------------| | | .-----------------. | |
| D2::C::Route | | | | D2::C::Request | |
This file contains 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 v5.10; | |
use MetaCPAN::API; | |
use Data::Dumper; | |
use List::AllUtils qw(min max); | |
use DateTime; | |
use DateTime::Format::ISO8601; | |
my @score_label = qw( | |
Abysmal | |
Poor |
This file contains 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
package MyApp; | |
use Carp; | |
use Dancer2; | |
my %routes; | |
sub uri_for_it { | |
my ( $name, $vars ) = @_; | |
my $route = $routes{$name}; | |
my $route_path = $route->spec_route; |
This file contains 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; | |
use warnings; | |
use AnyEvent; | |
use AnyEvent::HTTP; | |
use Promises 'deferred'; | |
my @urls = ( 'https://ddg.gg', 'http://dyndns.org', 'http://metacpan.org' ); | |
my $cv = AE::cv; | |
my $cb; $cb = sub { |
This file contains 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
# this function lets you run code in a fork | |
# and use a condvar on it to get the data | |
# and return it to the client in JSON form, all non-blocking and async | |
# based heavily on a trick by Assaf Gordon | |
sub async_response (&) { | |
my $cb = shift; | |
send_file( | |
\'noop', |
This file contains 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; | |
use warnings; | |
use DateTime; | |
my $dt = DateTime->new( | |
day => 13, | |
year => 2012, | |
); | |
my $count = 0; |
This file contains 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
.---------. | |
.----------.----------| Handler |--------.--------. | |
| | | '---------' | | | |
| | | | | | | |
| | | | | | | |
v v v '-> v v | |
.-----. .-----. .-----. .------------. .------. .-------. | |
| App | | App | | App | | Serializer | | Hook | | Route | | |
'-----' '-----' '-----' '------------' '------' '-------' |
NewerOlder