instancetype vs. id

Bringing it to the point, using - (instancetype)initWithFoo:(BOOL)bar has no technical advantage over - (id)initWithFoo:(BOOL)bar except for code consistency. As the compiler automatically translates id to instancetype. It's different with convenience constructor methods as an id won't get translated to instancetype there: + (id)initWithFoo:(BOOL)bar will return a generic object as where + (instancetype)initWithFoo:(BOOL)bar will return an object of class "instancetype". Thus, you got to take special care when instantiating singletons as it may easily conflict with the singleton pattern. Say you've got a class called MySingleton and you'd like to subclass this class and instantiate it using - (instancetype)sharedInstance what happens is that if the sharedInstance method is called…

SSL on blog.kida.io

As from today, this blog is (optionally) available over an SSL secured connection using a self-signed certificate. The fingerprint is 0D:C5:C8:1D:8C:DE:02:35:B7:21:77:FF:71:DB:C3:78:D8:DE:D6:8C if you'd like to confirm that you're not beein spoofed. Cheers!…

Setting the Timezone of your Ubuntu 12.04 machine

This evening I realized one of my VMs' Timezone was incorrectly due to some date shown wrongly in my Node.js App. A look at cat /etc/timezone revealed: America/New York Nope, that's not quite correct, setting the Timezone using dpkg-reconfigure tzdata Did it's job quite well ;-)…

SimPholders

I just meet an App helping me to fiddle around in my iOS Simulator's App-Folders without digging deep thorught my Filesystem, take a look at SimPholders.…

JSON Accelerator

If you ever need to generate an object model of a JSON payload I can clearly recommend you JSON Accelerator which is available for free at the App Store. Regardles wether you'd like to generate Objective-C, Java or Python classes, this small handy tool does it all.…

Using iptables to block incoming traffic directly to you node.js app

Kind of offtopic but every now and then I need to use iptables to block incoming traffic coming from the vps' virtual ethernet device directly going to my node.js apps. I'm generally using Nginx as a reverse proxy and want to prevent exposing my node.js apps. Off course i'm also using iptables to prevent exposing other ports to the outer world. To e.g. block tc ports 3000 to 8999 you may use this command: sudo iptables -A INPUT -i venet0 -p tcp --destination-port 3000:8999 -j DROP Whereas venet0 is the virtual ethernet device. Local requests coming from Nginx (or any other Reverse-Proxy) will reach the server as long as it's on the same device of course…