Xcode Plugins

You may find the following list of xcode plugins really useful:
http://maniacdev.com/xcode-plugins

This one is really working for me:
https://github.com/ksuther/KSImageNamed-Xcode

This one is also pretty useful when handling localization:
https://github.com/questbeat/Lin-Xcode5

Minimum viable product

Minimum viable product = MVP
Chrisとチャットしていて出てきた単語。知らなかった。

Lean startup whatisMVP_jp from Yuki Sekiguchi

NSMutableArrayの宣言

NSArrayが以下のように宣言できるようになったのはみなさんご存知のとおり。

NSArray *a = @[].copy;  

NSMutableArrayについても同じように宣言するのがベストと思っていたが、どうやらそうではないみたい。

NSMutableArray *ma = @[].mutableCopy;  

以下のように宣言するのがいいとのこと。

NSMutableArray *ma = [NSMutableArray array];  

iPhone Simulator

iPhoneシミュレータで現在地情報を取得するアプリを立ち上げるような場合に、設定でLocation Servivesをオンにしていても位置情報が取得できない問題。

解決方法
画面上部のメニューバーから、"Edit Scheme->Options"をクリック。"Default Location"をクリック後、都市を選択する。

http://stackoverflow.com/questions/3110708/cllocationmanager-on-iphone-simulator-fails-with-kclerrordomain-code-0

iBeacon

I found a *tutorial for iBeacon the other day.
Following this tutorial, you can make an iOS app tracking singals from other devices using iBeacon and vice varsa.

This is my sample iBeacon repository on GitHub:
https://github.com/hirokihori/iBeacon

*http://www.devfright.com/ibeacons-tutorial-ios-7-clbeaconregion-clbeacon/

And here's what I think I can do with iBeacon:

  • Make my iPhone say "Welcome home Sir. How was your day?" when I get home. (This would be more fun if we can use Siri API.)
  • Turn on "do not disturb" mode once I get to office and off when I get home.*
  • Tweet "Work Done" when I left office.

*Unlike Android, we are not allowed to tweak iOS settings(turn off bluetooth etc..) from an app yet.

Angular#1

Import Angular.js
To use controllers defined in another file(sample.js), you should just import it like below.

<html ng-app>  
...
<head>  
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
    <script src="sample.js"></script>
</head>  

Use controllers

<div ng-controller="sampleController">  
</div>  

sample.js

var sampleController = function($scope) {  
    ...
}

rem

html {  
    font-size: 62.5% // -> 10px
}

#blog-logo img {
    max-height: 2.2rem; // -> 22px (10 * 2.2)
    width: auto;
}

rem stands for "root em". The rem unit is relative to the root --or the html --element. This means we can define a single font size on the html element and define all rem units to be a percentage of that.

Updated: The default font size is 16px in web browsers.

FYI:
http://www.impressivewebs.com/understanding-em-units-css/

Creating an API using "Express"

I basically followed this tutorial:
http://www.codemag.com/Article/1210041

*One thing to mention:
When you start listening on localhost for the first time and you go to http://localhost:3000, you will get an error message saying "doctype 5 is deprecated, you must now use doctype html".
You just navigate to /views/layout.jade and edit the line:
"doctype 5" -> "doctype html" That's it.
FYI: http://stackoverflow.com/questions/20909817/error-on-brand-new-express-project-doctype-5-is-deprecated-you-must-now-use-d

Configuring "Ghost"

I'm running this blog using "Ghost".
Here is the list of tutorials/articles that I found helpful to set up ghost.

Setting up ghost using a DigitalOcean droplet:
http://ghosted.co/install-ghost-digitalocean/
https://www.digitalocean.com/community/articles/how-to-host-ghost-with-nginx-on-digitalocean

How to start ghost from commandline:
http://www.howtoinstallghost.com/how-to-start-ghost-as-a-service-on-linux/

How to add themes:
https://www.digitalocean.com/community/articles/how-to-change-themes-and-adjust-settings-in-ghost