Skip to content

Instantly share code, notes, and snippets.

# http://www.klab.jp/tenka1programer/bosyu.html
#
use strict;
use warnings;
use Encode qw(decode);
my $bytes = [qw/
e4bba5e4b88be381aee69687e5ad97e58897e381af5554462d38e38292e69687e5ad97
e382a8e383b3e382b3e383bce38387e382a3e383b3e382b0e5bda2e5bc8fe381a8e381
99e3828b3136e980b2e695b0e381aee38390e382a4e38388e58897e381a7e38182e3828be38082
@sekimura
sekimura / gist:137196
Created June 28, 2009 03:57
geotagging with GPX file
#!/usr/bin/env perl
use strict;
use warnings;
use Geo::Gpx;
use Image::ExifTool;
use Image::ExifTool::Location;
use File::Slurp qw(read_file);
use DateTime::Format::Strptime;
use YAML;
package Math::Base58;
use constant Alphanum => qw/
1 2 3 4 5 6 7 8 9
a b c d e f g h i
j k m n o p q r s
t u v w x y z A B
C D E F G H J K L
M N P Q R S T U V
W X Y Z
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>geolocation + Google Maps JavaScript API</title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize() {
navigator.geolocation.getCurrentPosition(showMap);
}
#!/usr/bin/perl
# Ported http://dacp.jsharkey.org/ to Perl
use strict;
use AnyEvent;
use AnyEvent::Socket;
use AnyEvent::HTTP;
use Net::Rendezvous::Publish;
use Net::DAAP::DMAP qw(:all);
my $port = 10020;
#!/usr/bin/perl
use strict;
use LWP::Simple;
use JSON;
use URI;
my $query = shift; ## need to be artist name at this point
my $uri = URI->new('http://www.lala.com/api/SearchPage/runBucketedSearch/v22.7.1-18');
$uri->query_form(
albumsQ => $query,
diff --git a/lib/AnyEvent/Twitter/Stream.pm b/lib/AnyEvent/Twitter/Stream.pm
index 5796eed..542bfd1 100644
--- a/lib/AnyEvent/Twitter/Stream.pm
+++ b/lib/AnyEvent/Twitter/Stream.pm
@@ -57,8 +57,13 @@ sub new {
});
my $reader; $reader = sub {
my($handle, $json) = @_;
- my $tweet = JSON::decode_json($json);
- $on_tweet->($tweet);
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" >
<mx:TextInput x="10" y="10" text="username" id="username"/>
<mx:TextInput y="10" text="password" id="password" visible="true" displayAsPassword="true" x="178"/>
<mx:TextInput y="41" width="255" text="track" id="track" x="10"/>
<mx:Button id="startButton" y="41" label="Start" click="connectStreamServer()" width="55" x="283"/>
<mx:Button id="stopButton" x="283" y="41" label="Stop" click="stopToConnect()" visible="false"/>
<mx:List dataProvider="{dp}" labelField="text" height="218" y="71" width="328" x="10"></mx:List>
<mx:Script>
#!/usr/bin/perl
package Server;
use AnyEvent::Socket ();
sub new {
my $class = shift;
my $self = bless {}, $class;
$self->{server_guard} = undef;
$self->{sessions} = {};
warn $self;
@sekimura
sekimura / gist:151840
Created July 22, 2009 06:11
simple echo server by using AnyEvent
#!/usr/bin/perl
use strict;
use warnings;
use AnyEvent;
use AnyEvent::Socket qw/tcp_server/;
use AnyEvent::Handle;
my $buf = '';