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
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 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
using System.Collections; | |
using UnityEngine; | |
public class NestCoroutine : MonoBehaviour | |
{ | |
private IEnumerator _coroutine; | |
private int _count; | |
private int Count | |
{ | |
get |
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 | |
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 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
#!/bin/sh | |
# pull したタイミングで .DS_Store を消して、 .DS_Store だけが含まれるフォルダを削除する。 | |
# | |
# まず .DS_Store を削除してから、 .DS_Store が入っていたディレクトリを rmdir する。 | |
# rmdir は空の場合しか削除しないので、中身が入っている場合はそのまま。 grep で不要なエラーメッセージを無視。 | |
find . -name .DS_Store -exec rm {} \; -exec sh -c 'rmdir `dirname {}` 2>&1 | grep -E -v "rmdir:.+: Directory not empty"' \; |
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
ruby -r json -e 'def f(o, i=0); oc = o["options"]["classname"]; on = o["options"]["name"]; print " " * i + "#{oc}, #{on}\n"; o["children"].each{|c| f c, i+2}; nil; end; ARGV.each {|j| p j; f JSON.load(open(j).read)["widgetTree"]}' *.json |
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
cat <(printf "\xEF\xBB\xBF") 元のUTF-8ファイル.txt > BOM付きUTF-8ファイル.txt |
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
@implementation MySharedThing | |
+ (id)sharedInstance | |
{ | |
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{ | |
return [[self alloc] init]; | |
}); | |
} | |
@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
# git の差分表示に使うには .git/info/attributes にこの内容と、 | |
*.mwb diff=MySQLWorkbench | |
# git config でこれが必要。 | |
# git config diff.MySQLWorkbench.textconv /path/to/mwb.sh |
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
# .gitignore 以外のファイルを全部無視する。 | |
* | |
!.gitignore |
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
[alias] | |
root = rev-parse --show-toplevel | |
basename = ! basename `git root` | |
zip = ! git archive --format=zip --output=`git basename`.zip HEAD |
NewerOlder