Skip to content

Instantly share code, notes, and snippets.

@suer
suer / ruby_patch.rb
Created December 7, 2015 03:01
Dark patch for Errbit
class NilClass
def match(pattern)
"".match(pattern)
end
end
class File
class << self
def dirname_with_nullable(filename)
return dirname_without_nullable(filename) if filename
@suer
suer / _nya_git.lua
Last active December 13, 2015 17:39 — forked from azu/_nya_git.lua
-- nyaosのgit向けluaコマンド
-- print('loading... "_nya_git.lua"')
-- $git submodule rm
-- サブモジュールの削除
-- http://labs.timedia.co.jp/2011/03/git-removing-a-submodule.html
nyaos.command['git submodule rm'] = function(name)
local modulepath = nyaos.eval('git config --file .gitmodules --get submodule.' .. name .. '.path');
nyaos.exec('git rm --cached ' .. modulepath);
nyaos.exec('git config --file .gitmodules --remove-section submodule.' .. name);
nyaos.exec('git commit -m "Remove submodule '..name..'"')
@suer
suer / init.rb
Created May 11, 2012 05:14
Redmine Plugin: add link to overall activities page
# Redmine Plugin: Add Link To Overall Activities.
#
# License:
# The MIT License (MIT) Copyright (c) 2012 suer
#
# Permission is hereby granted, free of charge, to
# any person obtaining a copy of this software and
# associated documentation files (the "Software"),
# to deal in the Software without restricti on,
# including without limitation the rights to use,
@suer
suer / check_redis.sh
Created April 19, 2012 07:28
nrpe で使用する Redis 死活監視スクリプト
#!/bin/sh
REDIS_CLI=/usr/local/redis/bin/redis-cli
result="$($REDIS_CLI dbsize 2>&1)"
status=$?
if [ $status -eq 0 ]; then
echo "OK: connection successful. dbsize = $result"
exit 0
fi
@suer
suer / asakusasatellite.css
Created August 11, 2011 04:21
twicli AsakusaSatellite theme
a { color: #E2041B }
.uicon { width: 16px; height: 16px; }
.utils { display: block; }
.tw-parent { background-color: #eee; }
body, #tw2 { color: #333; background-color: #eee; }
.tw-parent > hr { display: none; }
@suer
suer / redmine_codereview_plugin_for_1.2.0.patch
Created June 2, 2011 09:55
a patch for redmine_code_review_plugin (0.4.0) on redmine 1.2.0
diff -r -u haru_iida-redmine_code_review-9ec75c963e55/app/controllers/code_review_controller.rb redmine_code_review/app/controllers/code_review_controller.rb
--- haru_iida-redmine_code_review-9ec75c963e55/app/controllers/code_review_controller.rb 2011-02-22 00:27:10.000000000 +0900
+++ redmine_code_review/app/controllers/code_review_controller.rb 2011-06-04 16:39:21.000000000 +0900
@@ -310,7 +310,9 @@
def forward_to_revision
path = params[:path]
- entry = @project.repository.entry(path)
+ patharray = path.split('/')
+ entries = @project.repository.scm.entries(patharray[1..-2].join('/'), nil, {:report_last_commit => true})