This file contains 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/perl | |
use strict; | |
use warnings; | |
use Getopt::Long; | |
use LWP::Simple; | |
use File::Temp qw(tempdir); | |
use Archive::Tar; | |
use YAML; | |
use IPC::Run3; |
This file contains 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
= モジュールの依存関係 = | |
rpmbuild でパッケージを作る際に、use/require してるモジュールがすべて rpm の依存関係に含まれてしまう、という問題がある。eval しているモジュールは依存関係の対象とはならないが、以下のように複数行にまたがっていると、依存関係の対象になってしまう。 | |
{{{ | |
eval { | |
require 'Hoge'; | |
} | |
}}} | |
This file contains 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/perl -w | |
use strict; | |
sub register { | |
my ( $self, $qp ) = @_; | |
$self->register_hook("connect", "connect"); | |
$self->register_hook("auth-plain", "authsql" ); | |
$self->register_hook("auth-login", "authsql" ); |
This file contains 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/perl | |
use strict; | |
use warnings; | |
use Web::Scraper; | |
use URI; | |
use YAML; | |
use DateTime; | |
use DateTime::Format::W3CDTF; | |
use Encode; |
This file contains 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/perl | |
use strict; | |
use RPC::XML; | |
use RPC::XML::Client; | |
use Config::Pit; | |
use Data::ICal; | |
use Data::ICal::Entry::Event; | |
use DateTime::Format::ICal; |
This file contains 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 strict; | |
use warnings; | |
%} | |
%% | |
JSON : value | |
; | |
value : atom | |
| number | |
| string |
This file contains 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/python | |
import dotcloud.cli.cli as cli | |
import sys | |
from optparse import OptionParser | |
parser = OptionParser() | |
parser.add_option( | |
'--cmd', | |
dest='cmd', |
This file contains 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 spawn = require('child_process').spawn; | |
var input = 'test.aiff'; | |
var output = 'test.mp3'; | |
var named_pipe = 'pipe'; | |
var fifo = spawn('mkfifo', [ named_pipe ]); | |
fifo.on('exit', function() { | |
var mplayer = spawn('mplayer', [ input, '-ao', 'pcm:file=' + named_pipe ]); |
This file contains 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 ruby | |
# Convert Trac DB Wiki pages to Markdown source files | |
# This script is based on http://github.com/seven1m/trac_wiki_to_github which | |
# converted all pages from a Trac DB to GitHub Wiki format (as Textile). | |
# | |
# I made two changes: | |
# - uses MarkDown format instead | |
# - uses the sqllite3-ruby gem which does not need Ruby 1.9 |
This file contains 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 "rubygems" | |
require "active_record" | |
ActiveRecord::Base.establish_connection( | |
:adapter => "mysql2", | |
:host => "192.168.10.12", | |
:user => "root", | |
:password => "root", | |
:database => "typo", | |
:encoding => "utf8" |
OlderNewer