Skip to content

Instantly share code, notes, and snippets.

#!perl
use Dancer;
use LWP::UserAgent;
get '/' => sub {
return <<EOF;
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
name = App-Scrobble
author = Adam Taylor <[email protected]>
license = Perl_5
copyright_holder = Adam Taylor
copyright_year = 2012
[@Basic]
[PodSyntaxTests]
[PodCoverageTests]
#!/usr/bin/env perl
# PODNAME: App::scrobble
# ABSTRACT: foo
# VERSION
use strict;
use warnings;
use App::Scrobble;
@adamtaylor
adamtaylor / gist:1119770
Created August 2, 2011 07:45
Chrome greasemonkey script: why you no execute?!
// ==UserScript==
// @name MetaCPAN Everywhere
// @description Add to every link to CPAN a link to MetaCPAN on a Google results page.
// @namespace http://ajct.info
// @match http://*/*
// @version 0.1
// ==/UserScript==
(function() {
@adamtaylor
adamtaylor / gist:914312
Created April 11, 2011 20:51
node.js newbism
var jerk = require( 'jerk' ),
sys = require( 'sys' ),
sqlite = require( 'sqlite' );
var options = {
server: 'irc.freenode.net',
nick: 'Laurabelle',
channels: [ '#kkkk', ]
}
@adamtaylor
adamtaylor / gist:861012
Created March 8, 2011 20:49
cpanm --scandeps
adam:~ adam$ which cpanm
/Users/adam/perl5/perlbrew/bin/cpanm
adam:~ adam$ cpanm -V
cpanm (App::cpanminus) version 1.4001
adam:~ adam$ cpanm --scandeps WWW::NewsReach
--> Working on WWW::NewsReach
Fetching http://search.cpan.org/CPAN/authors/id/A/AJ/AJCT/WWW-NewsReach-0.03.tar.gz ... OK
Configuring WWW-NewsReach-0.03 ... OK
WWW-NewsReach-0.03
@adamtaylor
adamtaylor / gist:835123
Created February 19, 2011 15:30
Evil localisation of $_ ?
sub _format_key {
my $class = shift;
my ( $key ) = @_;
# Localise $_ so we can use functions that operate on $_ for berevity
local $_ = $key;
# Convert to the correct format/case
s/publishDate/publish_date/ if /publishDate/;
s/lastModifiedDate/last_modified_date/ if /lastModifiedDate/;
cpanm (App::cpanminus) 0.9929 on perl 5.008008 built for darwin-thread-multi-2level
Work directory is /Users/adam/.cpanm/work/1275128041.41102
You have make /usr/bin/make
You have LWP 5.834
You have /usr/bin/tar: tar (GNU tar) 1.15.1
You have /usr/bin/unzip
Searching Dist::Zilla on cpanmetadb ...
Fetching http://search.cpan.org/CPAN/authors/id/R/RJ/RJBS/Dist-Zilla-3.101461.tar.gz ... OK
Unpacking Dist-Zilla-3.101461.tar.gz
Entering Dist-Zilla-3.101461
public void updatePercepts() {
// manual hack to work(?) for all the taxi agent
for(int i = 0;i<3;i++) {
int j = i + 1;
String name = "taxi" + j;
clearPercepts(name);
// get the robot location
#!/usr/bin/perl -w
use strict;
use WWW::Mechanize;
use Data::Dumper;
main();
sub main {
my $mech = WWW::Mechanize->new();