Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/usr/bin/env perl | |
### | |
# This snippet will recursively scan directories for use/require statements | |
# in perl scripts or modules, making it easy to build a list of dependencies | |
# from code you've inherited or neglected to document. | |
### | |
use Perl::PrereqScanner; | |
use File::Spec::Functions qw( catfile ); | |
use File::Find qw(finddepth); | |
use Data::Dumper; |
#!/usr/bin/env perl | |
use Modern::Perl; | |
use Mojo::UserAgent; | |
use Mojo::IOLoop; | |
use Mojo::URL; | |
# FIFO queue | |
my $seed_url = 'http://www.google.co.uk/'; | |
my @urls = ($seed_url); |
#!/usr/bin/env perl | |
use strict; | |
use Modern::Perl; | |
use Domain::PublicSuffix; | |
use URI; | |
my $keyword = 'broadband'; | |
my @urls = qw(http://www.moneysupermarket.com/broadband/ | |
http://www.o2.co.uk/broadband |
package WebCrawl::Crawl; | |
use Mojo::Base 'Mojolicious::Controller'; | |
sub crawl { | |
my $self = shift; | |
# Increase inactivity timeout for connection a bit | |
Mojo::IOLoop->stream($self->tx->connection)->timeout(15); | |
# Change content type |
#!/usr/bin/env perl | |
use strict; | |
use Modern::Perl; | |
use Mojo::JSON qw(decode_json); | |
# seo-paid-visibility | |
my $raw = <<EOF; | |
{"data":{...}} | |
EOF |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
package Apis::Reddit; | |
use strict; | |
use warnings; | |
use Mojo::Log; | |
use DateTime; | |
use Mojo::UserAgent; | |
my $log = Mojo::Log->new(); | |
sub new { |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
#!/usr/bin/env perl | |
use strict; | |
use utf8; | |
use warnings qw(all); | |
use Modern::Perl; | |
use Mojo::Util qw(decode encode html_unescape xml_escape); | |
use Mojo::DOM; | |
use Mojo::Log; | |
use Mojo::Asset::File; |
upstream myapp { | |
server 127.0.0.1:8082; | |
} | |
server { | |
listen 80; | |
server_name example.com; | |
location / { | |
proxy_set_header X-Request-Base https://$host/myapp; |