Skip to content

Instantly share code, notes, and snippets.

View mattn's full-sized avatar
🍛
I love curry 🍛

mattn mattn

🍛
I love curry 🍛
View GitHub Profile
--- IO.xs.orig 2006-03-26 11:27:13.000000000 +0900
+++ IO.xs 2009-02-24 20:16:34.921875000 +0900
@@ -121,7 +121,12 @@
}
return RETVAL;
#else
+# ifdef WIN32
+ unsigned long flags = block;
+ return ioctl(PerlIO_fileno(f), FIONBIO, &flags);
+# else
set MODULEBUILDRC=c:/docume~1/mattn/local/.modulebuildrc
set PERL_MM_OPT=INSTALL_BASE=c:/docume~1/mattn/local
set PERL5LIB=c:/docume~1/mattn/local/lib/perl5;c:/docume~1/mattn/local/lib/perl5/MSWin32-x86-multi-thread;%PERL5LIB%
set PATH=c:/docume~1/mattn/local/bin:%PATH%
got d46438302f839f85631e2953c09a6c653833b390
walk d46438302f839f85631e2953c09a6c653833b390
got 17cbee3478c5a25cb4ffbfe3c4f935afdcae02d0
got cc5a270bf0c516d633b89971d574ce8d3fba8672
Getting alternates list for http://github.com/miyagawa/remedie.git
got 7f9cf3e13db1e91955c3563b24a08bcfff924a90
got b81e766e3d8dc96309594d6cdc2734c018f91d80
got a05187203c2da1f66383c582014780d46bcaf11a
Getting pack list for http://github.com/miyagawa/remedie.git
Getting index for pack e574caaff9f33182d911d873acbb0cdf5f339bd4
use strict;
use warnings;
use URI;
use LWP::UserAgent;
use HTTP::Request::Common;
my $url = 'http://localhost/localstart.asp';
my $ua = new LWP::UserAgent(keep_alive=>1);
print $ua->credentials('localhost:80', '', "domain\\username", 'password')."\n";
Index: lib/Plagger/Plugin/UserAgent/AuthenRequest.pm
===================================================================
--- lib/Plagger/Plugin/UserAgent/AuthenRequest.pm (revision 2063)
+++ lib/Plagger/Plugin/UserAgent/AuthenRequest.pm (working copy)
@@ -19,6 +19,7 @@
my $creds = $self->conf->{credentials} || [ $self->conf ];
for my $auth (@$creds) {
+ $auth->{realm} ||= '';
$context->log(info => "Adding credential to $auth->{realm} at $auth->{host}");
use strict;
use warnings;
use utf8;
use String::Trigram;
my @cmpBase = qw(もまんが もみんが ももんが うみんが);
my $trig = new String::Trigram(cmpBase => \@cmpBase);
my %result;
my $numOfSimStrings = $trig->getSimilarStrings("ももんが", \%result);
From a77b5f904f84785c158d8e38729a6d74dd87dc7f Mon Sep 17 00:00:00 2001
From: mattn <[email protected]>
Date: Mon, 9 Mar 2009 13:08:33 +0900
Subject: [PATCH] use Config::IniFiles instead of Config::INI::Simple
---
lib/Plagger/Plugin/Subscription/PlanetINI.pm | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/lib/Plagger/Plugin/Subscription/PlanetINI.pm b/lib/Plagger/Plugin/Subscription/PlanetINI.pm
@mattn
mattn / dan-the-shell.rb
Created March 11, 2009 03:33
dan the shell
require "readline"
require 'json'
require 'cgi'
require 'open-uri'
while buf = Readline.readline("dan> ", true)
res = open("http://api.dan.co.jp/perleval.cgi?c=callback&s=#{CGI.escape(buf)}")
if /^callback\((.*)\)/ =~ res.read
puts JSON.parse($1)['result']
end
@mattn
mattn / dansh.cpp
Created March 11, 2009 04:38
dan the shell
// for MSVC: cl -I.. /Tp dansh.cpp curl.lib readline.lib ..\Release\json.lib
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <io.h>
namespace json {
#include "json.h"
}
#define READLINE_STATIC
#include <readline/readline.h>
@mattn
mattn / dan-the-shell.nako
Created March 11, 2009 07:30
dan the shell
母艦は「dan the shell」。
!変数宣言が必要
ルートメニューとはメインメニュー
ファイルメニューとはメニュー
実行とは、メニュー。実行のテキストは「実行」
区切り1とは、メニュー。区切り1のテキストは「-」
閉じるとは、メニュー。閉じるのテキストは「閉じる」