Skip to content

Instantly share code, notes, and snippets.

@karronoli
karronoli / my_tt.pl
Created October 17, 2010 13:40
simple text template
use strict;
use warnings;
use utf8;
print sub {
my %arg = @_;
my ($k, $v, $in) =
($arg{keyword}, $arg{value}, $arg{input});
my $i = index($in, $k);
if($i == -1) {
return $in;
@karronoli
karronoli / flymake-growl.el
Created December 30, 2010 12:35 — forked from kawaguchi/flymake-growl.el
Flymake + Growl for Windows
(require 'flymake)
(setq flymake-growl-warning-priority 1)
(setq flymake-growl-error-priority 2)
(setq flymake-growl-warning-sticky t)
(setq flymake-growl-error-sticky t)
(setq flymake-growl-sticky-list nil)
@karronoli
karronoli / gist:840565
Created February 23, 2011 15:34
ftp.exe script file to self NTFS Stream
call :HOGE %0 && ftp -s:%0:ftp
goto :EOF
:HOGE
echo prompt > %1:ftp
echo open ftp.ring.gr.jp >> %1:ftp
echo anonymous>> %1:ftp
echo.>> %1:ftp
echo get index-j.html>> %1:ftp
@karronoli
karronoli / test-more_not-ascii-testname-tests.pl
Created January 1, 2012 03:39
todo_output bug? for Test::More->builder
use strict;
use warnings;
use utf8;
use Test::More;
use Encode::Locale;
use Encode;
my $eco = find_encoding($Encode::Locale::ENCODING_CONSOLE_OUT);
diag($Encode::Locale::ENCODING_CONSOLE_OUT);
=pod Windows + cp932環境で日本語のテストケース名を出力する例
@karronoli
karronoli / compile.pl
Last active May 6, 2019 15:47
perl compile test(roughly equivalent 'perl -c')
package Hoge;
our $a = 1;
1;
package main;
use strict;
use warnings;
use Test::More;
our $a = 1;
@karronoli
karronoli / bugspots.py
Created January 9, 2012 06:52
Google bugspots for Mercurial + python
from mercurial import ui, hg
import re
import time
import math
import sys
DEBUG = 0
repo = hg.repository(ui.ui(), sys.argv[1])
message_matchers = re.compile('fix(es|ed)?|close(s|d)?', re.IGNORECASE)
@karronoli
karronoli / hatena_nico.js
Last active November 3, 2015 06:11
b.hatena.ne.jp/video + niconico customize
// ==UserScript==
// @name test
// @namespace http://d.hatena.ne.jp/karronoli
// @description add nicovideo info to b.hatena.ne.jp/video
// @include http://b.hatena.ne.jp/video
// @version 1.0
// ==/UserScript==
(function () {
"use strict";
@karronoli
karronoli / 3.bat
Created January 21, 2012 02:52
command prompt test. escap & redirect to stdin
@rem call cmd.exe /v:on /c "cmd.exe /c c.bat & echo HOGE_!ERRORLEVEL!"
@rem return HOGE_255(stdout)
find /V "THIS_STRING_IS_NO_USE_IN_BAT" <%~0 >redirect.bat & cmd.exe /v:on /c "redirect.bat >%~n0.log 2>&1" & set REDIRECT=!ERRORLEVEL! & del redirect.bat & exit /b !REDIRECT!
set TEST_ENV=1
echo hoge
echo redirect %TEST_ENV% 1>&3
if () UNEXPECTED_EXIT
sleep 1
exit /b 3
@karronoli
karronoli / gist:1803125
Last active September 30, 2015 13:58 — forked from avocado3/gist:1801194
Bookmarklet:open Pixitail by illust_id
javascript:(function(id){id&&location.href="pixitail://org.cathand.pixitail/pixiv/"+id})(prompt("illust_id?"))
@karronoli
karronoli / excel_test.js
Created March 4, 2012 11:29
Open or Create excel book by specified sheet name.
var file_name = "hello.xls",
target_sheet_name = "Hello.t",
bin_dir = WScript.ScriptFullName.replace(WScript.ScriptName, ""),
excel = new ActiveXObject("Excel.Application"),
fso = new ActiveXObject("Scripting.FileSystemObject");
var path = fso.buildPath(bin_dir, file_name);
var book = (fso.FileExists(path))
? excel.Workbooks.Open(path)
: excel.Workbooks.Add();
var work_sheet = (function(sheet_name) {