This file contains hidden or 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
@interface NSManagedObject (Serialization) | |
- (NSDictionary*) toDictionary; | |
- (void) populateFromDictionary:(NSDictionary*)dict; | |
+ (NSManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict | |
inContext:(NSManagedObjectContext*)context; | |
@end |
This file contains hidden or 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
var crypto = require('crypto'); | |
var AESCrypt = {}; | |
AESCrypt.decrypt = function(cryptkey, iv, encryptdata) { | |
encryptdata = new Buffer(encryptdata, 'base64').toString('binary'); | |
var decipher = crypto.createDecipheriv('aes-128-cbc', cryptkey, iv), | |
decoded = decipher.update(encryptdata); |
This file contains hidden or 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
-- [[ Cheatsheet for LUA from http://www.newthinktank.com/2015/06/learn-lua-one-video/]] | |
-- Prints to the screen (Can end with semicolon) | |
print("Hello World") | |
--[[ | |
Multiline comment | |
]] | |
-- Variable names can't start with a number, but can contain letters, numbers |
This file contains hidden or 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
-- Drawing the map as isometric tiles | |
self.tilesHovered = {} -- Reset the tilesHovered table every frame | |
for i = 1, #self.map do -- Loop trough rows | |
for j = 1, #self.map[i] do -- Loop through cols in the rows | |
if self.map[i][j] ~= 0 then -- If there is a tile to draw | |
local x = | |
self.x + -- Starting point | |
(j * ((self.tileWidth / 2) * self.scale)) - -- The width on rows | |
(i * ((self.tileWidth / 2) * self.scale)) -- The width on cols |