Skip to content

Instantly share code, notes, and snippets.

@satoshin2071
satoshin2071 / PatternMatchingPart3.swift
Last active May 24, 2016 07:24
Swift Pattern Matching, Part 3: Custom pattern matching & syntactic sugar. Shakyo practice.
/*
From http://alisoftware.github.io/swift/pattern-matching/2016/04/24/pattern-matching-3/
Shakyo practice
Pattern Matching, Part 3: Custom pattern matching & syntactic sugar
*/
import XCPlayground
@satoshin2071
satoshin2071 / PatternMatchingPart2.swift
Last active May 24, 2016 07:24
Swift Pattern Matching, Part 2: tuples, ranges & types. Shakyo practice.
/*
From http://alisoftware.github.io/swift/pattern-matching/2016/03/30/pattern-matching-2/
Shakyo practice
Pattern Matching, Part 2: tuples, ranges & types
*/
import XCPlayground
@satoshin2071
satoshin2071 / PatternMatchingPart1.swift
Last active May 24, 2016 07:23
Swift Pattern Matching, Part 1: switch, enums & where clauses. Shakyo practice.
/*
From http://alisoftware.github.io/swift/pattern-matching/2016/03/27/pattern-matching-1/
Shakyo practice
Pattern Matching, Part 1: switch, enums & where clauses
*/
import Foundation

良いまとめ

##概要

  • 現行は IPv4 と IPv6 の両方に対応しているが、今後 IPv6 のみのサポートになるらしい
  • そのための、サーバ/アプリ での対応内容
# 対象ディレクトリ
included:
- TrySwiftLint # FIXME: 適宜プロジェクト名に変更
# 除外ディレクトリ
excluded:
- Pods
# 追加ルール(ルールが適用されていないようであれば追記すること)
opt_in_rules:
- force_unwrapping
@satoshin2071
satoshin2071 / gist:324e0440c689ccb1db2a01500e7b656c
Created May 18, 2016 00:34
gitの認証でmacのダイアログが邪魔なときの設定
gitの認証でmacのダイアログが邪魔なときにする設定、jenkins、gitlab-ci等
macのヘルパーがデフォルトで設定されているのでこれを外す
```
git config --local --unset credential.helper
git config --global --unset credential.helper
git config --system --unset credential.helper
```

インスペクタを使いやすく

http://tsubakit1.hateblo.jp/entry/2015/01/03/203843

TooltipAttribute や HeaderAttribute を丁寧に書いておくだけでも大分使いやすくなる

Playモード時の色を変更する

Playモード時にAssets,インスペクタ,ヒエラルキにオーバーレイさせる色を設定しておくとわかりやすくなる。マゼンタとか。

transoformを x=>0, y=>0, z=>0にする

@satoshin2071
satoshin2071 / NSString+CharacterCheck.m
Created March 7, 2016 05:46
NSString 絵文字チェック
#import "NSString+CharacterCheck.h"
/**
サロゲートペアの前半部分 下位の値
*/
static const unichar MinimumHighSurrogate = 0xD800;
/**
サロゲートペアの前半部分 上位の値
*/
@satoshin2071
satoshin2071 / railsStart.md
Last active May 17, 2016 09:56
リモートにあるRailsプロジェクトを落としてローカル環境で動かすまでの備忘録

リモートにあるRailsプロジェクトを落としてローカル環境で動かすまでの備忘録

環境

Mac OSX 10.10.5

前提条件

  • リモートにあるRailsのバージョンは4.2とする