This file contains 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
cat <(printf "\xEF\xBB\xBF") 元のUTF-8ファイル.txt > BOM付きUTF-8ファイル.txt |
This file contains 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
git-flow っぽい git のログから pull requests を再現する。 | |
``` | |
git log master --reverse --grep 'feature.*into develop' --format='%p %s' --merges --after=2017-03-23 --before=2017-06-01 | ruby -pe "\$_.gsub! /Merge branch '(.+)'.*/, '\\1'" | |
``` | |
で、特定期間の develop ブランチへマージしたログを切り出す。 | |
これを make_pulls.rb に渡すと、そのマージコミットを再現する pull req を作る。 | |
何かエラーが出たら止まるので手動で対応する。 :innocent: |
This file contains 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 | |
require "yaml" | |
UNITY_DIR_PREFIX = ENV.fetch("UNITY_DIR_PREFIX", "/Applications/Unity") | |
unity_args = ARGV.dup | |
project_path = Dir.getwd | |
path_arg = ARGV.index("-projectPath") | |
if path_arg |
This file contains 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
using System.Collections; | |
using UnityEngine; | |
public class NestCoroutine : MonoBehaviour | |
{ | |
private IEnumerator _coroutine; | |
private int _count; | |
private int Count | |
{ | |
get |
This file contains 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
@implementation MySharedThing | |
+ (id)sharedInstance | |
{ | |
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{ | |
return [[self alloc] init]; | |
}); | |
} | |
@end |
This file contains 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
# git の差分表示に使うには .git/info/attributes にこの内容と、 | |
*.mwb diff=MySQLWorkbench | |
# git config でこれが必要。 | |
# git config diff.MySQLWorkbench.textconv /path/to/mwb.sh |
This file contains 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
# .gitignore 以外のファイルを全部無視する。 | |
* | |
!.gitignore |
This file contains 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
[alias] | |
root = rev-parse --show-toplevel | |
basename = ! basename `git root` | |
zip = ! git archive --format=zip --output=`git basename`.zip HEAD |
This file contains 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
# 全コミットのチェックサムと、キーワードが削除が表示されるので、キーワードの削除の上の行を見たらどのコミットかわかる。 | |
git log --follow --patch ファイルのパス | grep -E '^commit|^-.*キーワード' | |
# --follow : ファイル名の変更を追跡する。 | |
# --patch : パッチの形式でファイルの差分を表示する。 | |
# grep -E : | をそのまま使いたいので。 | |
# ^commit : どのコミットかわかるように commit で始まる行を表示する。 | |
# ^-.* : 削除だけが見たいので - で始まる行だけを表示する。 |
This file contains 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
# http://d.hatena.ne.jp/nakamura001/20120824/1345832011 の「複数回実行するとBOMデータが実行しただけ追加されてしまうので必ず1回だけ実行する様に気を付けて下さい。」が気になったので書きなおした。 | |
ruby -e 'ARGV.each{|file|a=open(file).read().gsub(/\A(\xef\xbb\xbf)*/m,"\xef\xbb\xbf"*2);open(file,"w").write(a);}' /Applications/Unity/Unity.app/Contents/Resources/ScriptTemplates/81-C#\ Script-NewBehaviourScript.cs.txt |
NewerOlder