Skip to content

Instantly share code, notes, and snippets.

@kits
kits / log.txt
Created March 14, 2012 07:47
README.pod in top directory
$ h2xs -XAn Foo
Defaulting to backwards compatibility with perl 5.12.2
If you intend this module to be compatible with earlier perl versions, please
specify a minimum perl version with the -b option.
Writing Foo/lib/Foo.pm
Writing Foo/Makefile.PL
Writing Foo/README
Writing Foo/t/Foo.t
Writing Foo/Changes
@kits
kits / forstylish.css
Created March 7, 2012 08:51
perldoc.jp style (like search.cpan.org)
@namespace url(http://www.w3.org/1999/xhtml);
/* CSS for stylish (override author CSS) */
@-moz-document domain("perldoc.jp") {
html {
font-size:100% !important;
}
body {
@kits
kits / myapp.pl
Created February 25, 2012 00:28
Mojolicious redirect
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
$self->redirect_to('/foo');
};
app->start;
@kits
kits / gist:1832374
Created February 15, 2012 01:37
Portablebbs setup fail
$ perl t/module.t list --fail > /dev/null
DBD::SQLite 1.35 is unknown
Object::Simple 3.0625 is unknown
Validator::Custom 0.1426 is unknown
DBIx::Custom 0.2111 is unknown
Mojolicious 2.46 is unknown
DBIx::Connector 0.47 is unknown
$ perl t/module.t list --fail | perl cpanm -L extlib
DBD::SQLite 1.35 is unknown
Object::Simple 3.0625 is unknown
@kits
kits / Bookmarklet URI
Created January 16, 2012 09:54
全文または選択範囲をマルチカラム化(Firefox用)
javascript:(function(){%0A%09var%20sel%20=%20window.getSelection(),%0A%09%09body%20=%20document.body,%0A%09%09src;%0A%0A%09if%20(sel.isCollapsed)%20{%0A%09%09src%20=%20body.innerHTML;%0A%09}%0A%09else%20{%0A%09%09var%20frag%20=%20sel.getRangeAt(0).cloneContents();%0A%09%09var%20div%20=%20document.createElement('div');%0A%09%09div.appendChild(frag);%0A%09%09src%20=%20div.innerHTML;%0A%09}%0A%0A%09/*%20other%20window%20*/%0A%09//var%20win%20=%20window.open('',%20'_blank');%0A%09/*%20this%20widow%20*/%0A%09var%20win%20=%20window;%0A%0A%09var%20doc%20=%20win.document;%0A%09doc.open();%0A%09doc.write('<body>',%20src,%20'</body>');%0A%09doc.close();%0A%0A%09var%20bstyle%20=%20doc.body.style;%0A%09bstyle.MozColumnWidth%20=%20'25em';%0A})()
@kits
kits / html5.htc
Created January 9, 2012 05:05
HTML5 Shiv HTC
<public:attach event="oncontentready" onevent="" />
<script type="text/javascript">
var doc = element.document;
var win = doc.parentWindow;
// HTML5 Shiv v3 | @jon_neal @afarkas @rem | MIT/GPL2 Licensed
// Uncompressed source: https://github.com/aFarkas/html5shiv
(function(a,b){var c=function(a){return a.innerHTML="<x-element></x-element>",a.childNodes.length===1}(b.createElement("a")),d=function(a,b,c){return b.appendChild(a),(c=(c?c(a):a.currentStyle).display)&&b.removeChild(a)&&c==="block"}(b.createElement("nav"),b.documentElement,a.getComputedStyle),e={elements:"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),shivDocument:function(a){a=a||b;if(a.documentShived)return;a.documentShived=!0;var f=a.createElement,g=a.createDocumentFragment,h=a.getElementsByTagName("head")[0],i=function(a){f(a)};c||(e.elements.join(" ").replace(/\w+/g,i),a.createElement=function(a){var b=f(a);return b.canHaveC
@kits
kits / clean_google_links.user.js
Last active September 27, 2015 22:38
clean google links
@kits
kits / ExcelColConv.pl
Created November 4, 2011 07:51
Excel列名変換
#!perl
# Excel列名 ←→ 数値 変換
# http://d.hatena.ne.jp/JunichiIto/20111102/1320253815
use strict;
use warnings;
my %abc2num;
for (1 .. 26) {
@kits
kits / screensaverblocker.js
Created June 24, 2011 08:31
screen saver blocker
var WshShell = WScript.CreateObject("WScript.Shell");
while (1) {
var intButton = WshShell.Popup(
"Quit?", 60, "Blocker", 0 + 32);
if (intButton == 1)
break;
else
WScript.Sleep(100);
@kits
kits / pod2html_2.pl
Created February 1, 2011 05:19
pod2html の日本語ヘッダへのアンカーをWikipedia風に変更
#!/usr/bin/env perl
# pod2html の日本語ヘッダへのアンカーをWikipedia風に変更。
# 使い方は pod2html と同じ。
use strict;
use warnings;
use Pod::Html;
{