Skip to content

Instantly share code, notes, and snippets.

View skaji's full-sized avatar

Shoichi Kaji skaji

  • Kanagawa, Japan
  • 12:20 (UTC +09:00)
View GitHub Profile
@skaji
skaji / google-calendar.css
Last active October 2, 2015 13:38
For google calendar that starts on Monday
/* Saturday */
table.st-bg-table tr td.st-bg:nth-last-of-type(1)
{
background-color: aliceblue;
}
/* Sunday */
table.st-bg-table tr td.st-bg:nth-of-type(1)
{
background-color: mistyrose;
@skaji
skaji / twitter.css
Last active October 4, 2015 07:18
twitter custom css
/* 広告など消す */
div[data-component-term="japanese_ad"],
.site-footer,
#j_ad,
.promptbird
{
display: none !important;
}
/* 左右逆転、ツイート部分大きく */
@skaji
skaji / indent.pl
Created August 19, 2012 00:51
Changes the number of indent spaces.
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Getopt::Long qw{:config auto_help};
use Pod::Usage qw{pod2usage};
GetOptions(\my %opt, qw{in=i out=i}) or pod2usage(1);
$opt{in} ||= 4; # the default number of input indent spaces
@skaji
skaji / gist:3390716
Created August 19, 2012 01:08
vim commentout
" inline commentout
noremap <silent> ,# :s/^/#/<CR>:nohlsearch<CR>
noremap <silent> ,/ :s/^/\/\//<CR>:nohlsearch<CR>
noremap <silent> ," :s/^/\"/<CR>:nohlsearch<CR>
noremap <silent> ,c :s/^\(\s*\)\(\/\/\\|[#"]\)/\1/<CR>:nohlsearch<CR>
" block commentout
vnoremap <silent> ,p d:set paste<CR>0i=pod<CR>=cut<CR><ESC>kkp:set nopaste<CR>
vnoremap <silent> ,r d:set paste<CR>0i=begin<CR>=end<CR><ESC>kkp:set nopaste<CR>
vnoremap <silent> ,< d:set paste<CR>0i<!--<CR>--><CR><ESC>kkp:set nopaste<CR>
@skaji
skaji / bing_async.pl
Created August 21, 2012 17:27
Image Download
#!/usr/bin/env perl
use strict;
use warnings;
use Encode qw{encode_utf8 decode_utf8};
use utf8;
use LWP::UserAgent;
use HTTP::Request;
use Digest::MD5 qw/md5_hex/;
use Path::Class qw/dir file/;
use URI;
@skaji
skaji / pbcopy.pl
Created September 14, 2012 20:20
TeraTerm でクリップボードにコピー
#!/usr/bin/env perl
use strict;
use warnings;
use MIME::Base64;
use Encode;
binmode STDIN, ':encoding(utf8)';
my $input = do {
local $/;
<STDIN>;
@skaji
skaji / gist:3728737
Created September 15, 2012 16:36
Plackup file or directory
function plackfile() {
plackup -MPlack::App::File \
-e "Plack::App::File->new(file => q{$1})"
}
alias plackdir="plackup -MPlack::App::Directory \
-e 'Plack::App::Directory->new'"
@skaji
skaji / plack-static.pl
Created September 15, 2012 17:23
plackup with a static file or directory
#!/usr/bin/env perl
use strict;
use warnings;
my $path = shift || '.';
if (-f $path) {
exec qw{plackup -MPlack::App::File -e},
"Plack::App::File->new(file => q($path))->to_app";
}
@skaji
skaji / color.pl
Created September 18, 2012 17:13
terminal color test
#!/usr/bin/env perl
use strict;
use warnings;
my @block = (0, 30, 40, 90, 100);
my @index = 0 .. 7;
for my $num1 (map { my $b = $_; map { $b + $_ } @index; } @block) {
for my $i (@index) {
for my $b (@block) {
@skaji
skaji / gist:3795366
Created September 27, 2012 17:47
print templates
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
if ($ARGV[0] =~ /-h/) {
my ($script) = $0 =~ m{([^/]+)\z}xsm;
print <<"HELP";
usage:
$script ls # display available templates
$script xxx # print xxx template