This file contains hidden or 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
require 'em/mysql' | |
require 'sequel/async' | |
require 'digest/sha1' | |
module Hector | |
# Identity adapters must implement the following public methods: | |
# - authenticate(username, password) | |
# - remember(username, password) | |
# - forget(username) | |
# - normalize(username) |
This file contains hidden or 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
var move = function(e) { | |
var width = document.viewport.getWidth(); | |
var left = windows.hasClassName('nicklist') ? 200 : 100; | |
var visible = toggle.hasClassName('visible'); | |
if (!visible && width - e.pointerX() > left) | |
return; | |
window.onmousemove = null; | |
toggle.addClassName('visible'); |
This file contains hidden or 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 Alice::Role::HTTPD; | |
use AnyEvent; | |
use Any::Moose 'Role'; | |
use Plack::Builder; | |
use Plack::Middleware::Static; | |
use Plack::Session::Store::File; | |
use Plack::Session::State::Cookie; |
This file contains hidden or 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
leedo@usealice:~/usealice$ perl -MCarp::Always app.psgi | |
Use of uninitialized value $_[0] in join or string at /home/leedo/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/File/Spec/Unix.pm line 86 | |
File::Spec::Unix::catdir('File::Spec', undef) called at /home/leedo/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/File/Spec/Unix.pm line 100 | |
File::Spec::Unix::catfile('File::Spec', undef) called at /home/leedo/perl5/lib/perl5/Dancer/FileUtils.pm line 33 | |
Dancer::FileUtils::d_catfile(undef, 'views') called at /home/leedo/perl5/lib/perl5/Dancer/FileUtils.pm line 39 | |
Dancer::FileUtils::path(undef, 'views') called at /home/leedo/perl5/lib/perl5/Dancer/Template/MicroTemplate.pm line 28 | |
Dancer::Template::MicroTemplate::init('Dancer::Template::MicroTemplate=HASH(0x2451e58)', 'name', 'micro_template', 'config', 'HASH(0x2488030)', 'type', 'template') called at /home/leedo/perl5/lib/perl5/Dancer/Object.pm line 15 | |
Dancer::Object::new('Dancer::Template::MicroTemplate', 'name', 'micro_template', 'type', 'template', 'config', ' |
This file contains hidden or 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
1 #!/usr/bin/perl | |
2 use AnyEvent::Feed; | |
3 | |
4 my @image_urls; | |
5 my $img_re = qr{https?://[^\s]+\.(?:gif|png|jpe?g)}i; | |
6 | |
7 my $feed = AnyEvent::Feed->new( | |
8 url => 'http://cutegirlsbeingcute.tumblr.com/rss', | |
9 interval => 60 * 60, # every hour | |
10 on_fetch => sub { |
This file contains hidden or 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 Plack::Builder; | |
use AnyEvent::Feed; | |
use POSIX qw/ceil/; | |
my @image_urls; | |
my $img_re = qr{https?://[^\s]+\.(?:gif|png|jpe?g)}i; | |
my $feed = AnyEvent::Feed->new( | |
url => 'http://cutegirlsbeingcute.tumblr.com/rss', | |
interval => 60 * 60, # every hour |
This file contains hidden or 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 Plack::Builder; | |
use AnyEvent::Feed; | |
my $feeds = {}; | |
my $img_re = qr{https?://[^\s]+\.(?:gif|png|jpe?g)}i; | |
sub add_feed { | |
my $url = shift; | |
$feeds->{$url} = { | |
images => [], |
This file contains hidden or 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
#!/usr/bin/env perl | |
use ExtUtils::MakeMaker; | |
WriteMakefile( | |
PREREQ_PM => {'AnyEvent::Feed' => '0.3'}, | |
PREREQ_PM => {'AnyEvent::Redis' => '0.23'}, | |
PREREQ_PM => {'Redis' => '1.904'}, | |
); |
This file contains hidden or 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
#!/bin/sh | |
BASE=$HOME/src/usealice | |
NAME=imageproxy | |
PSGI=psgi/$NAME.psgi | |
LOG=log/$NAME.log | |
PID=var/$NAME.pid | |
STATUS=var/$NAME.status | |
PORT=5008 |
This file contains hidden or 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
#!/usr/bin/env perl | |
use JSON; | |
use AnyEvent; | |
use AnyEvent::Twitter; | |
use AnyEvent::Feed; | |
die "need json file with oauth credentials\n" unless -e $ARGV[0]; | |
my @queue; |