NSBundle *bundle = [NSBundle mainBundle];
NSDictionary *info = [bundle infoDictionary];
if ([info objectForKey: @”SignerIdentity”] != nil)
{
/* Looks like this is app is pirated */
}
I use the built-in OSX screen capture tools a lot when I’m working. By default, when using the Command+Shift+3/4 options, these captures are saved to the desktop — which gets messy fast when you use them often. A number of months ago I found a great tip on changing the default save location of these screen captures, and so now I have them saving to a folder in my Documents and have put that folder into my dock as a Stack, making them easily accessible but out of the way.
To change the default save location, open up Terminal and run the following command:
defaults write com.apple.screencapture location /Users/YOURUSERNAME/Documents/ScreenshotsObviously you would change the path to match whatever folder you want the captures to save into. You will need to log out and back in before you will see the changes. Once done, go to the new save folder and drag it down into the right-hand side of your dock. Now whenever you save a screen capture it will automagically appear down in your Stack :)
Of course, if you don’t need a saved copy of the capture you can also add the Ctrl key to the mix when taking it — this will save the screen capture onto your clipboard rather than saving a file, and you can then paste it directly into a document.
H2O PHP TEMPLATING ENGINE / LIKE DJANGO
Wow finally I found something that really makes me like PHP so much more. Recently I have been trying to do every new project I start in Google App Engine. Simply I love the Django templates that allows me to quickly build up the project in a tiny amount of code.
After a quick search I found H20 templating system which is port of the Django system.
http://github.com/speedmax/h2o-php/tree/master
The documentation is quick and excellent, setup is simple.
To get started code is simple as this.
*in your template*
{{ person.name }}
*in php*
$person =array(
‘name’ => ‘Peter Jackson’, ‘age’ => 25
);
$h2o->render(compact(‘person’));
?>
OK, so that was easy. But you can also get your template to inherit your layout or base template which means it will automatically write into pre-defined areas of this template.
Since using this, it has turned 2-3 pages of pretty messy code down to 3-4 pages of super tiny simple code that is extensible.