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
#!/bin/bash | |
| |
echo "You enter a dark dungeon. A sign in front of you says: Choose wisely or you'll probably die." | |
read -p 'staging or production: ' ENV | |
| |
if [ $ENV != "staging" ] && [ $ENV != "production" ] | |
then | |
echo "You go into the wrong hallway, a skeleton comes out and decapitates you. The End." | |
exit 1 | |
fi |
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
// Mantle is a framework that allows you to interchange JSON formatted data into model objects. | |
// You can read more about it here: https://github.com/Mantle/Mantle | |
// Using mantle is simple, create an object that inerhits from MTLModel, and it must also implement MTLJSONSerializing protocol. | |
#import <Mantle/Mantle.h> | |
@interface ModelObject : MTLModel <MTLJSONSerializing> |
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 and NSDictionary have methods to write to files using the .plist format | |
// If your array/dictionary only contains NSNumber, NSDate, NSData or NSString objects, this works like a charm! | |
NSArray *strings = @[@"stringOne", @"stringTwo"]; | |
NSString *filePath = @"/Path/To/Documents/data.plist"; | |
BOOL successfullyWroteFile = [strings writeToFile:filePath atomically:YES]; | |
// For error handling, you can check the successfullWroteFile variable |