Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use Encode;
use LWP::Simple;
use HTML::TreeBuilder::XPath;
use Date::Japanese::Era;
use Unicode::Japanese;
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use YAML::Syck;
my @raw = <DATA>;
chomp @raw;
my $id = 1;
// ==UserScript==
// @name BigankiPlusOne
// @namespace http://fuba.me/
// @include https://plus.google.com/*
// ==/UserScript==
GM_addStyle([
".eswd {background-image: url(http://pi.fuba.me/pics/motemen.gif)}",
".esw {width:111px; height:138px}"
].join(""));
@fuba
fuba / iEPG_generator.pl
Created June 28, 2011 13:57
指定されたクエリからiEPGを生成するサービス
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use Encode;
use Mojolicious::Lite;
use YAML::Syck;
use File::Slurp;
@fuba
fuba / default.js
Created May 31, 2011 16:36
dotjs-ify my greasemonkey user scripts
function GM_getValue (key) {
var value = localStorage.getItem('GM_'.key);
if ('undefined' == typeof(value)) {
return;
}
return value;
}
function GM_setValue (key, value) {
localStorage.setItem('GM_'.key, value);
#!/usr/bin/perl
use utf8;
use warnings;
use strict;
use Encode;
mkdir encode_utf8 '福神づけ';
@fuba
fuba / twitter.com.js
Created May 20, 2011 21:35 — forked from cxx/decode_kanji_image.user.js
~/.js/twitter.com.js
var showImage = function () {
$('.tweet-text', document.body).each(function(index, elem) {
if ($('canvas', elem).length > 0) return;
var match = elem.textContent.match(/(k-host\.appspot\.com\/)?([\u4e00-\u8dff]{109,124})/);
if (!match) return;
var text = match[2];
var cols = 18;
var scale = 16;
var dataLen = text.length;
@fuba
fuba / gist:983211
Created May 20, 2011 15:48
sleep_sort
% perl -e 'my$s="1 2 2 ".("1 " x 100000);print $s' | xargs ./sleep_sort.sh >> result
% wc -l result
100003 result
% perl -e 'while(<>){$i++;if(/2/){warn $i}}' result
499 at -e line 1, <> line 499.
500 at -e line 1, <> line 500.
@fuba
fuba / tenji.rb
Created May 19, 2011 18:09 — forked from gyuque/hannya.rb
点字SHA1
require 'digest/sha1'
# http://www.unicode.org/reports/tr44/tr44-6.html
# http://www.unicode.org/Public/UNIDATA/Scripts.txt
CHARS = [10240,10241,10242,10243,10244,10245,10246,10247,10248,10249,10250,10251,10252,10253,10254,10255,10256,10257,10258,10259,10260,10261,10262,10263,10264,10265,10266,10267,10268,10269,10270,10271,10272,10273,10274,10275,10276,10277,10278,10279,10280,10281,10282,10283,10284,10285,10286,10287,10288,10289,10290,10291,10292,10293,10294,10295,10296,10297,10298,10299,10300,10301,10302,10303,10304,10305,10306,10307,10308,10309,10310,10311,10312,10313,10314,10315,10316,10317,10318,10319,10320,10321,10322,10323,10324,10325,10326,10327,10328,10329,10330,10331,10332,10333,10334,10335,10336,10337,10338,10339,10340,10341,10342,10343,10344,10345,10346,10347,10348,10349,10350,10351,10352,10353,10354,10355,10356,10357,10358,10359,10360,10361,10362,10363,10364,10365,10366,10367,10368,10369,10370,10371,10372,10373,10374,10375,10376,10377,10378,10379,10380,10381,10382,10383,10384,10385,10386,10387,10
wget http://www.unicode.org/Public/UNIDATA/Scripts.txt
perl -ne 'if (/BRAILLE/) {my $l = $_;$l=~/^([\w\.]+)/;my$n=$1;$n=~s/(^|\.)([^\.])/${1}0x${2}/g;if($n!~/\.\./){$n="${n}..${n}";}print eval("join(\",\",${n})");print","}' Scripts.txt