Skip to content

Instantly share code, notes, and snippets.

#!/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;
= モジュールの依存関係 =
rpmbuild でパッケージを作る際に、use/require してるモジュールがすべて rpm の依存関係に含まれてしまう、という問題がある。eval しているモジュールは依存関係の対象とはならないが、以下のように複数行にまたがっていると、依存関係の対象になってしまう。
{{{
eval {
require 'Hoge';
}
}}}
#!/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" );
#!/usr/bin/perl
use strict;
use warnings;
use Web::Scraper;
use URI;
use YAML;
use DateTime;
use DateTime::Format::W3CDTF;
use Encode;
#!/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;
%{
use strict;
use warnings;
%}
%%
JSON : value
;
value : atom
| number
| string
#!/usr/bin/python
import dotcloud.cli.cli as cli
import sys
from optparse import OptionParser
parser = OptionParser()
parser.add_option(
'--cmd',
dest='cmd',
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 ]);
@mizzy
mizzy / convert_trac.rb
Created October 29, 2011 07:51 — forked from somebox/convert_trac.rb
Convert Trac Wiki to Markdown
#!/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
@mizzy
mizzy / typo_to_jekyll.rb
Created October 29, 2011 11:34
Convert typo blog contents to jekyll posts
require "rubygems"
require "active_record"
ActiveRecord::Base.establish_connection(
:adapter => "mysql2",
:host => "192.168.10.12",
:user => "root",
:password => "root",
:database => "typo",
:encoding => "utf8"