Skip to content

Instantly share code, notes, and snippets.

View laynemoseley's full-sized avatar
💭
putting together all the pieces of the puzzle

Layne Moseley laynemoseley

💭
putting together all the pieces of the puzzle
  • crumbl
  • up north
View GitHub Profile
@laynemoseley
laynemoseley / deploy.sh
Last active October 1, 2019 19:16
Zork deploy script
#!/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
// 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>
@laynemoseley
laynemoseley / gist:5fb41ca89eed62fb1ea1
Created April 15, 2015 13:06
Property List Serialization
// 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