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
// ==UserScript==
// @name Hatena::Group: Recent Entries
// @namespace http://lowreal.net/
// @include https://*.g.hatena.ne.jp/
// @include http://*.g.hatena.ne.jp/
// @require http://svn.coderepos.org/share/lang/javascript/jsdeferred/trunk/jsdeferred.userscript.js
// @require http://gist.github.com/3239.txt#createElementFromString
// @require http://gist.github.com/46391.txt#duration
// @require http://gist.github.com/120040.txt#ambtime
// ==/UserScript==
use strict;
use warnings;
package A;
INIT {
foreach (keys %::) {
my ($module) = /^(.+)::$/ or next;
eval { $module->isa(__PACKAGE__) } or next;
no strict 'refs';
var STYLES = [
{ favs: 5, style: 'color: red; font-size: 140%; font-weight: bold' },
{ favs: 3, style: 'color: purple; font-size: 120%; font-weight: bold' },
{ favs: 2, style: 'color: green; font-size: 110%; font-weight: bold' }
];
var tweets = $X('//div[@class="tweetContainer"]', Array);
for (var i = 0; i < tweets.length; i++) {
var elem = $X('./div/div/div[@class="theTweet"]', tweets[i], Array)[0];
var favs = $X('./div/div[contains(@class,"favouritesCount")]', tweets[i], Number);
さようなら! http://gyazo.com/ff963bf3962ae877e80c73ca8a7e5caf.png 固有名詞
かお (╬☉д⊙) 固有名詞
かお (゚Д゚) 固有名詞
かお (◔ิД◔ิ ) 固有名詞
かお ╮(╯ε╰)╭ 固有名詞
かお (╯Д╰)σ 固有名詞
かお (◕‿◕✿) 固有名詞
かお (☣‿☣) 固有名詞
ぎすぎす (`Д´) 固有名詞
あせ (;´Д`) 固有名詞
#!/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;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>boards</key>
<array>
<dict>
<key>name</key>
<string>img</string>
use strict;
use warnings;
use LWP::Simple 'get';
eval get 'http://gist.github.com/287107.txt' or die $@;
#!/usr/bin/perl
use strict;
use warnings;
use List::MoreUtils qw(any);
sub git;
chdir git('rev-parse --git-dir') . '/..';
my @submodules = map [split /\s+/]->[-1], grep /^160000 /, git 'ls-files --stage';
// ==UserScript==
// @name hatenaquestion is an oshietekun
// @namespace http://www.hatena.ne.jp/motemen/
// @include http://twitter.com/hatenaquestion*
// @require http://gist.github.com/3238.txt#$X
// ==/UserScript==
$X('//a[starts-with(.,"http://q.hatena")][@class="tweet-url web"]').forEach(function (_) _.parentNode.removeChild(_));
sub Test::Builder::_print_to_fh {
my( $self, $fh, @msgs ) = @_;
return if $^C;
my $msg = join '', @msgs;
local ( $\, $", $, ) = ( undef, ' ', '' );
$msg =~ s{\n(?!\z)}{\n# }sg;