This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert -delay 0.5 -loop 0 -dispose previous tanuki*.png tanuki_anim.gif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
GYO = 20 | |
RETSU = 20 | |
num_letters = num_gyo = num_retsu = 0 | |
open(ARGV.last) do |io| | |
io.each_char do |c| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
basename = ARGV.shift | |
in_list = ARGV.map{|num| "#{basename}_#{num}.png" }.join(' ') | |
`convert -delay 17.5 -loop 0 -dispose previous #{in_list} #{basename}.gif` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro do-with-val-macro (val &rest body) | |
`(let ((,val 1)) | |
,@body) | |
) | |
(defmacro do-with-val-macro2 (spec) | |
`(let ((,(car spec) 1)) | |
,@(cdr spec)) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class IRCNotifierError extends Exception {} | |
class IRCNotifier { | |
private $_socket; | |
function __construct($url, $options) { | |
$url_info = parse_url($url); | |
if ($url_info === false) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun html-quote (str) | |
(replace-regexp-in-string "[&<>]" | |
(lambda (m) | |
(or (cdr (assq (string-to-char m) | |
'((?& . "&") | |
(?< . "<") | |
(?> . ">")))) | |
m)) | |
str)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dotfileのsymlinkつくるルール | |
rule /\/\..+?$/ => [proc {|task_name| | |
File.basename(task_name).sub(/^\./, '') | |
}] do |t| | |
if !File.exist?(t.name) and !File.symlink?(t.name) | |
ln_s t.source, t.name | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar anything-c-sources-local-gem-file | |
'((name . "gems (local)") | |
(candidates-in-buffer) | |
(init . (lambda () | |
(unless (anything-candidate-buffer) | |
(call-process-shell-command | |
"gem list" nil (anything-candidate-buffer 'global) | |
)))) | |
(action . (lambda (gem-name) | |
(setq gem-name (replace-regexp-in-string "\s+(.+)$" "" gem-name)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
commands.addUserCommand( | |
['rcopy'], 'Copy for Regexp match string', | |
function(args, bang, count) { | |
var text = (function (e, re) { | |
var m = e.textContent.match(re); | |
if (m) return m[0]; | |
for (var i = 0; i < e.children.length; i++) { | |
var result = arguments.callee(e.children[i], re); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nkfはデフォルトで半角カナを全角カナにしてくれたり、未定義文字を良い感じにしてくれるので、String#encodeで変換できなかった文字はnkfに渡す。 | |
# -xを渡すと、半角全角変換はしない。 | |
str.encode('EUC-JP', Kconv.guess(str), fallback: -> char { NKF.nkf('-ex', char) }) |
OlderNewer