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
require 'vr/vrcomctl'
require 'vr/vrlayout'
$confs = []
IO.popen("ipconfig /all","r"){|f|
conf=nil
f.each_line{|n|
n=n.rstrip
if n =~ /^ /
$confs.last << n
@mattn
mattn / 0001-path-workaround-for-windows.patch
Created June 9, 2009 05:36
path workaround for windows
From eeca3c96a2c73d4ba901b0056060a530c38a2dd4 Mon Sep 17 00:00:00 2001
From: mattn <[email protected]>
Date: Tue, 9 Jun 2009 14:39:45 +0900
Subject: [PATCH] path workaround for windows.
---
lib/Ark/Command/Interface.pm | 7 ++++++-
lib/Ark/Command/Server.pm | 7 ++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
Index: lib/background.pl
===================================================================
--- lib/background.pl (revision 15)
+++ lib/background.pl (working copy)
@@ -6,6 +6,7 @@
my $pipe = IO::Pipe->new;
sub start_job_server{
+ return if $ENV{'GATEWAY_INTERFACE'};
return if $ENV{'SINATRA_ENVIRONMENT'} eq "TASK";
From 70c770e81efd42323c9842e8ce8d4608a822d02a Mon Sep 17 00:00:00 2001
From: mattn <[email protected]>
Date: Tue, 16 Jun 2009 10:48:05 +0900
Subject: [PATCH] win32 support.
---
lib/grit.rb | 4 +++-
lib/grit/git.rb | 16 ++++++++++++----
2 files changed, 15 insertions(+), 5 deletions(-)
From 193538404516e3e2853d13663654099405ff97bf Mon Sep 17 00:00:00 2001
From: mattn <[email protected]>
Date: Tue, 16 Jun 2009 15:59:23 +0900
Subject: [PATCH] description is empty when edit 'description' file.
---
ginatra.rb | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/ginatra.rb b/ginatra.rb
#include <windows.h>
#include <stdio.h>
int main(void) {
printf("%d\n", LoadLibrary("C:/Perl/site/lib/auto/Event/Event.dll"));
printf("%d\n", LoadLibrary("C:/Perl/site/lib/auto/Coro/Event/Event.dll"));
return 0;
}
use strict;
use warnings;
use LWP::UserAgent;
use JSON;
use YAML;
sub irc_session {
my ($ua, $nick) = @_;
my $res = $ua->post("http://webchat.freenode.net/e/n", {nick => $nick});
my $id = @{from_json($res->decoded_content)}[1];
import os
import hamsterdb
if os.path.exists("test.db"):
os.remove("test.db")
db = hamsterdb.db()
db.create("test.db")
for i in range(0, 1000000):
db.insert("%d"%i, "%d"%i)
#!/bin/sh
AUTH=`echo \`ppit get wassr.jp\` | sed -n "s/^--- \"password\": '\\([^\"]\\+\\)' \"username\": '\\([^\"]\\+\\)'$/\2:\1/p"`
case $1 in
show)
w3m http://wassr.jp/user/$2
;;
post)
curl -u $AUTH -d status="$2" http://api.wassr.jp/statuses/update.json
#!/bin/sh
USER=mattn
LAST=0
while true; do
CURRENT=`curl -s http://rpc.reader.livedoor.com/notify?user=$USER | sed 's/^|\([0-9]\+\)|.*/\1/'`
if [ $LAST -lt $CURRENT ]; then
notify-send "livedoor Reader Notifier" "$CURRENT 件の未読記事があります。"
fi
LAST=$CURRENT