This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/3178087/hack.sh | sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static NSDateFormatter *formatter = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once( &onceToken, ^{ | |
formatter = [[NSDateFormatter alloc] init]; | |
formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss"; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory | |
NSString *filePath = [documentsPath stringByAppendingPathComponent:@"image.jpg"]; //Add the file name | |
[((Image *)obj).scaledImage writeToFile:filePath atomically:YES]; //Write the file | |
// | |
// retrieve the image | |
// | |
NSData *pngData = [NSData dataWithContentsOfFile:filePath]; | |
UIImage *image = [UIImage imageWithData:pngData]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIImage * imageToScale = [UIImage imageNamed:@"desktop-image"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// The type of relationship you establish determines when a connected | |
// view controller is instantiated by iOS, as follows: | |
// | |
// - If the relationship is a segue, the destination view controller is | |
// instantiated when the segue is triggered. | |
// | |
// - If the relationship represents containment, the child view | |
// controller is instantiated when its parent is instantiated. | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
// Override point for customization after application launch. | |
NSLog( @"Window: %@", self.window.rootViewController ); | |
self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; | |
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; | |
UIViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"MapKitNavigationController"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
ami: "amazon machine image", | |
dopt: "dhcp options set", | |
eni: "elastic IP address", | |
i: "instance", | |
igw: "internet gateway", | |
vol: "ebs volume", | |
vpc: "virtual private cloud" | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" | |
" Never commit this file until you have had a chance to at least run vim with | |
" your changes, and preferably actually had a chance to test the changes | |
" themselves. There have been multiple time (at least three) when vim wouldn't | |
" even start correctly because of changes to my _vimrc configuration. | |
" | |
set nocompatible | |
source $VIMRUNTIME/vimrc_example.vim | |
source $VIMRUNTIME/mswin.vim | |
behave mswin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Learn more about F# at http://fsharp.net | |
// | |
open System; | |
open System.IO; | |
printfn "\n"; | |