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
@mattn
mattn / gist:304597
Created February 15, 2010 12:09 — forked from xaicron/gist:304564
#!/usr/bin/env perl
use strict;
use warnings;
use Encode;
use Gtk2 -init;
my $data = decode_utf8 do { local $/; <STDIN> } || '';
&main();exit;
// Running JSDeferred on WSH
var _util = {
cat : function(f){
if(f.match(/^http:/)) {
var xhr = new ActiveXObject("Microsoft.XMLHTTP");
xhr.open("GET", f, false);
xhr.send();
return xhr.responseText;
}
return (new ActiveXObject("Scripting.FileSystemObject")).OpenTextFile(f,1,false).ReadAll();
#if _WIN32_WINNT < 0x0500
# error "should be NT"
#endif
#include <windows.h>
#include <tlhelp32.h>
#include <winternl.h>
#include <stdio.h>
DWORD getppid()
{
@mattn
mattn / peyon.go
Created November 27, 2009 06:32 — forked from yappo/mattn.go
ใƒšใƒจใƒณ้ †
package main
import "sort";
type PeYon []string
func (p PeYon) Len() int {
return len(p);
}
func (p PeYon) Less(i, j int) bool {
return p[i] < p[j];
// ==UserScript==
// @name gist: replace title with filename
// @namespace http://d.hatena.ne.jp/youpy/
// @include http://gist.github.com/*
// @exclude http://gist.github.com/gists
// ==/UserScript==
(function() {
var $ = $ || unsafeWindow.$;
var username = $('#owner a').text()
้–ข่ฅฟใ‚‚้›จใงใ™ใ€‚
@mattn
mattn / gist:188520
Created September 17, 2009 14:30 — forked from iratqq/gist:188518
mattn: ใ•ใ„ใŸใพใ•ใ„ใŸใพใƒผ?
ใ„ใˆใ€ใกใŒใ„ใพใ™
ใกใŒใ†ใฎใ‹
ใœใ‚“ใœใ‚“ใกใŒใ„ใพใ™ใ€‚
ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ ใ€€ ใ€€ใ€€ใ€€ ใ€€ ใ€€ ใ€€ ใ€€ ใ€€ใ€€โ”Œโ”€โ”€โ”€โ”
ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ ใ€€ ใ€€ ใ€€ ใ€€ ใ€€ใ€€ใ€€| ใ• |
@mattn
mattn / gist:188422
Created September 17, 2009 09:29 — forked from yappo/gist:188421
mattn: ใ•ใ„ใŸใพใ•ใ„ใŸใพใƒผ?
ใ„ใˆใ€ใกใŒใ„ใพใ™
@mattn
mattn / gist:188420
Created September 17, 2009 09:26 — forked from tokuhirom/gist:188418
mattn: pipe() ใฏ Perl ใฎๅ ดๅˆใ€win32 ใงใ‚‚ใ†ใ”ใใพใ™ใ‹?
ๅ‹•ใใพใ™ใ€‚
-----------------------------------------
#!/usr/bin/perl -w
use IO::Handle;
pipe(PARENTREAD, PARENTWRITE);
# Blosxom Plugin: urlshorter
# Author(s): Kyo Nagashima <[email protected]>, http://hail2u.net/
# Version: 2009-04-15
# Documentation: See the bottom of this file or type: perldoc urlshorter
package urlshorter;
use strict;
use vars qw($link_element);