Skip to content

Instantly share code, notes, and snippets.

View mono0926's full-sized avatar
🐶
( ´・‿・`)

mono — Masayuki Ono mono0926

🐶
( ´・‿・`)
View GitHub Profile
@mono0926
mono0926 / daily_report
Created August 11, 2013 04:33
daily_report
echo "$(PROJECT=$(url=$(git config remote.origin.url) && url=${url#*github.com?} && echo ${url%.git}) && echo "hash | title" && echo "-----|------" && git log --since='12 hours ago' --author=$(git config user.email) --pretty="format:[%h](https://github.com/$PROJECT/commit/%h) | %s" | perl -nle "\$_ =~ s|#(\\d+)|[#\\1](https://github.com/${PROJECT}/pull/\\1)|g; print \$_")" | pbcopy
@mono0926
mono0926 / ipdb.md
Created August 24, 2013 04:12
Debugging with ipython and ipdb

GitHub Flow

31 Aug 2011

git-flowの問題点 (Issues with git-flow)

私は人々にGitを教えるためにあちこちを飛び回っているが、最近のほぼすべてのクラスやワークショップで git-flow についてどう思うかを尋ねられた。私はいつも、git-flowは素晴らしいと思うと答えている。何百万ものワークフローを持ったシステム(Git)を提供し、ドキュメントもあるし、よくテストされている。フレキシブルなワークフローは、実に容易なやり方で多くの開発者の役に立つ。標準的なものになりつつあり、開発者はプロジェクトや企業の間を移動しつつこの標準的なワークフローに馴染むことができる。

<!-- copy this to YOUR_THEME.tmTheme-->
<dict>
<key>name</key>
<string>diff: deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>

storyboard上で、initial view controllerから他のview controllerに対してrelationshipを確立します。同様に、それらのview controllerから他のview controllerにrelationshipを確立します。最終的に、storyboard上のほとんど、あるいは全てのview controllerを一つのグラフに接続します。接続されたview controllerが、iOSによっていつインスタンス化されるかは、relationshipのタイプによって決まります。

@mono0926
mono0926 / angular.jade
Created May 14, 2014 11:17
Jade sample
extends layout
block content
script(src="javascripts/angular.js")
link(rel='stylesheet', href='/stylesheets/angular.css')
h1 AngularJS and Jade and Styles Exmples
div(ng-controller="HelloWorldController")
h2 文字列を表示する
p {{message}}
div(ng-controller="SampleController")
h2 2つの記法の使い分け
/// <reference path="../../typings/tsd.d.ts" />
function HelloWorldController($scope) {
$scope.message = 'Hello World!!';
}
function SampleController($scope) {
$scope.simple = '簡易記法を使った方法';
$scope.directive = 'ディレクティブを使った方法';
}
function SampleController2($scope) {
$scope.text = 'TextBox';
.red
color red
.blue
color blue
.solid-border
border 1px solid black
.dotted-border
border 1px dotted black
li
margin-top 10px
:lipstick::lipstick: when improving the format/structure of the code
:racehorse::racehorse: when improving performance
:non-potable_water::non-potable_water: when plugging memory leaks
:memo::memo: when writing docs
:penguin::penguin: when fixing something on Linux
:apple::apple: when fixing something on Mac OS
:checkered_flag::checkered_flag: when fixing something on Windows
:bug::bug: when fixing a bug
:fire::fire: when removing code or files
:green_heart::green_heart: when fixing the CI build
@mono0926
mono0926 / gist:5af3fcdc872eb506002f
Last active August 29, 2015 14:15
Register and remove notification
// extension
extension UIViewController {
func observeDidBecomeActive(action: Selector) -> () -> () {
return observeNotification(action, name: UIApplicationDidBecomeActiveNotification)
}
private func observeNotification(action: Selector, name: String) -> () -> () {
NSNotificationCenter.defaultCenter().addObserver(self, selector: action, name: name, object: nil)
return {
return NSNotificationCenter.defaultCenter().removeObserver(self, name: name, object: nil)
}