Skip to content

Instantly share code, notes, and snippets.

@ngyuki
ngyuki / svn-change-author.sh
Created August 17, 2012 02:36
Subversion でユーザー名を一括置換する
#!/bin/bash
URL=http://example.com/repos/piyo/
DRY=0
OLD=hoge
NEW=fuga
for REV in $(svn log -q "$URL" | grep -w $OLD | awk '{print $1}'); do
VAL=$(svn propget svn:author --revprop -$REV "$URL")
@ngyuki
ngyuki / gist:3292015
Created August 8, 2012 04:25
フォームなどの Rectangle が画面内に収まるようにサイズや表示位置を調整する(マルチモニタ対応)
private Rectangle AdjustmentWindowBounds(Rectangle bounds)
{
var workarea = Screen.FromRectangle(bounds).WorkingArea;
if (workarea.Contains(bounds) == false)
{
if (bounds.Width > workarea.Width)
{
bounds.Width = workarea.Width;
}