Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
# Convert GitHub Issues API to RSS feeds using Plagger
# script:scripts/github-issues.pl miyagawa/remedie
use strict;
use warnings;
use LWP::Simple;
use JSON::XS;
my $proj = shift @ARGV || "miyagawa/remedie";
my $json = get("http://github.com/api/v2/json/issues/list/$proj/open");
package HTTP::Engine::Middleware::Profile::NYTProf;
use Any::Moose;
use Devel::NYTProf;
use Time::HiRes;
with 'HTTP::Engine::Middleware::Profile::Role';
has header_name => (
is => 'rw',
default => 'X-NYTProf-Id',
);
18:45 miyagawa: Ugh. Hate software
18:45 miyagawa: local::lib + MakeMaker 6.30 (that comes with Leopard) don't like each other
18:45 miyagawa: because of INSTALL_BASE vs INSTALLBASE
18:46 miyagawa: so I have my perl modules set up in ~/perl5 with local::lib. So far so good
18:46 miyagawa: i have a script that has non-core CPAN dependencies. I want to bundle all of those in extlib
18:47 GumbyNET_ has left IRC (Ping timeout: 360 seconds)
18:47 miyagawa: I did perl -MCPAN -Mlocal::lib=--self-contained,exlib -e 'CPAN::install(modules)'
18:47 miyagawa: which fails in the first place because of File::HomeDir's delayed load of Mac::Files
18:48 miyagawa: File::HomeDir::Darwin is loaded from my ~/perl5
18:48 miyagawa: but now local::lib with --self-contained disables the ~/perl5 as well as /System/Library/Perl/Extras
use strict;
use warnings;
use CPAN;
use Mac::Files; # for File::HomeDir::Darwin delayed loads
use ExtUtils::MakeMaker 6.31;
# now clears up the existent local::lib
$ENV{PERL5LIB} = '';
require local::lib;
import local::lib '--self-contained', './extlib';
-- Set selected Address Book contact pictures from Gravatar.
-- Released under GPL.
-- by Doug Smith, http://smithsrus.com
-- Fixed md5_email routine by Tatsuhiko Miyagawa
-- Grab the selected records and see how many there are.
tell application "Address Book"
set selected_contacts to selection
set count_selected to number of items in selected_contacts
% perl -MLWP::Simple -MLocale::Country -e 'for (all_country_codes) { $u = sprintf "http://www.southparkstudios.com/episodes/notavailable/sorry_%s01.jpg", uc $_; $i = LWP::Simple::get($u); warn $u if $i }'
http://www.southparkstudios.com/episodes/notavailable/sorry_DK01.jpg at -e line 1.
http://www.southparkstudios.com/episodes/notavailable/sorry_GB01.jpg at -e line 1.
http://www.southparkstudios.com/episodes/notavailable/sorry_SE01.jpg at -e line 1.
http://www.southparkstudios.com/episodes/notavailable/sorry_NO01.jpg at -e line 1.
http://www.southparkstudios.com/episodes/notavailable/sorry_FR01.jpg at -e line 1.
http://www.southparkstudios.com/episodes/notavailable/sorry_FI01.jpg at -e line 1.
http://www.southparkstudios.com/episodes/notavailable/sorry_AU01.jpg at -e line 1.
http://www.southparkstudios.com/episodes/notavailable/sorry_NZ01.jpg at -e line 1.
http://www.southparkstudios.com/episodes/notavailable/sorry_CA01.jpg at -e line 1.
@miyagawa
miyagawa / qpsmtpd-smtp-tls-forward.patch
Created May 6, 2009 08:10
Support SMTP TLS (for Gmail)
diff --git a/plugins/queue/smtp-forward b/plugins/queue/smtp-forward
index f7e212b..00f42a1 100644
--- a/plugins/queue/smtp-forward
+++ b/plugins/queue/smtp-forward
@@ -35,7 +35,11 @@ sub init {
if (@args > 1 and $args[1] =~ /^(\d+)$/) {
$self->{_smtp_port} = $1;
}
- $self->log(LOGWARN, "WARNING: Ignoring additional arguments.") if (@args > 2);
+ if (@args > 2 and $args[2] && $args[3]) {
@miyagawa
miyagawa / http-post
Created May 6, 2009 08:38
smtp2web plugin for qpsmtpd
#!perl
=head1 NAME
queue/http-post
=head1 DESCRIPTION
This plugin posts email body to an URI as HTTP POST.
diff --git a/Dock Integration.user.js b/Dock Integration.user.js
index e83864d..2e0a52d 100644
--- a/Dock Integration.user.js
+++ b/Dock Integration.user.js
@@ -62,7 +62,7 @@ function __lalaDockBadgeManager() {
// Wait until the page is loaded before trying to do anything with the Dock badge
window.addEventListener('load', function() {
- if (!window.__lalaDockBadge_Initialized) {
+ if (0 && !window.__lalaDockBadge_Initialized) {
#!/usr/bin/perl
use CGI;
use LWP::Simple;
my $js = LWP::Simple::get("http://home.ingdirect.com/js/accounttype.js");
my %rates = ($js =~ /(type_.*?_apy)='([\d\.]+)'/g);
use Data::Dumper;
print CGI::header('text/html'), "<html><body>";