Skip to content

Instantly share code, notes, and snippets.

View motemen's full-sized avatar
🌴
On vacation

Hironao OTSUBO motemen

🌴
On vacation
View GitHub Profile
@fuba
fuba / exthtml.pl
Created December 26, 2008 09:14
exthtml.pl extracts contents specified by an xpath from web pages. Cookbook in Japanese: http://fuba.jottit.com/exthtml
#!/usr/bin/perl
use strict;
use warnings;
use Encode;
use Getopt::Long;
use URI;
use LWP::UserAgent;
use HTTP::Cookies::Guess;
#!/usr/bin/perl
# original: http://search.cpan.org/src/MIYAGAWA/WWW-NicoVideo-Download-0.01/eg/fetch-video.pl
use strict;
use WWW::NicoVideo::Download;
use Term::ProgressBar;
use Config::Pit;
use URI;
use HTML::TreeBuilder::XPath;
use Perl6::Say;
// ==UserScript==
// @name Hatena::Diary: Fix edit-in-place toolbar tabindex
// @namespace http://lowreal.net/
// @include http://d.hatena.ne.jp/*/
// ==/UserScript==
location.href = "javascript:"+encodeURIComponent(uneval(function () {
Hatena.Diary.EditInPlace.Form.addEventListener('create', function (day) {
Array.forEach(day.element.querySelectorAll('.edit-in-place-toolbar a'), function (e) {
e.tabIndex = 9999;
@charset "utf-8";
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
menuitem#tombloo-menu-share {
display: none;
}
Starman:
- Preforking standalone HTTP server
- Based on Catalyst::Engine::HTTP::Prefork by Andy Grundma
- Ported to Plack by Tatsuhiko Miyagawa
- Uses Net::Server::PreFork
- Supports HTTP/1.1
- Pipelined requests
- Chunked request/response
- Keep-Alives
- Graceful restart with HUP (No shutdown with QUIT yet)
// ==UserScript==
// @name G+: notify update
// @namespace http://buycheapviagraonlinenow.com/
// @include https://plus.google.com/*
// ==/UserScript==
var notifyServerUrl = 'http://localhost:5678/', // https://gist.github.com/1021283
element = document.querySelector('.gbids'),
last;
@sotarok
sotarok / servers.rb
Created August 24, 2011 02:18
inherit previous roles of a task for capistrano server selection.
# based on: http://pastie.org/293845
module Capistrano
class Configuration
module Servers
alias_method :original_find_servers, :find_servers
def find_servers(options={})
servers = original_find_servers options
stack_roles = task_call_frames.collect {|frame| frame.task.options[:roles]}.compact.flatten
=pod
Nyan Cat TAP Formatter
1. Save this file into your PERL5LIB
2. Run prove with option like following:
$ prove --formatter NyanCat
http://www.mattsears.com/articles/2011/11/16/nyan-cat-rspec-formatter
@hail2u
hail2u / hatom-in-microdata.html
Created December 5, 2011 14:08
hAtomをMicrodataで(修正した感じ
<body itemscope itemtype="http://microformats.org/profile/hatom">
<article itemscope itemtype="http://microformats.org/profile/hatom#hentry">
<h2 itemprop="entry-title">
<a rel="bookmark"
href="http://hail2u.net/blog/webdesign/document-structure.html"
itemprop="url">
文書構造を見なおした(ている)
</a>
</h2>
<footer>
@theory
theory / gist:1542242
Created December 31, 2011 00:41
How to add a Transaction Guard to a DBIx::Connector Subclass
package DBIx::Connector::TxnGuard;
use strict;
use warnings;
use Carp;
sub new {
my ($class, $dbh) = @_;
$dbh->begin_work;
return bless { dbh => $dbh };
}