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
#import <Foundation/Foundation.h> | |
typedef enum { | |
PXRImageSizeUtilVerticalAlignTop, | |
PXRImageSizeUtilVerticalAlignBottom, | |
PXRImageSizeUtilVerticalAlignMiddle | |
}PXRImageSizeUtilVerticalAlign; | |
typedef enum { | |
PXRImageSizeUtilHorizontalAlignLeft, |
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
''' | |
Script to crop dead space in images and save out coordinates in the file name. Requires PIL to be installed: | |
http://www.pythonware.com/products/pil/ | |
usage: | |
python crop_images.py path/to/input/dir path/to/output/dir | |
''' | |
from PIL import Image | |
from PIL import ImageOps | |
import os | |
import sys |
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
''' | |
requires imagemagick to be installed. http://www.imagemagick.org/script/index.php | |
''' | |
import os | |
import sys | |
import subprocess | |
import argparse | |
# defines the input we want to use. Change the directory name or the target DPI to set this. | |
inputDirName = "drawable-xhdpi" |
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
''' | |
requires imagemagick to be installed. http://www.imagemagick.org/script/index.php | |
requires pngquant to be installed if using compression on pngs. http://pngquant.org/ | |
''' | |
import os | |
import sys | |
import subprocess | |
import argparse | |
import shutil | |
import mimetypes |
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/python | |
import os | |
import shutil | |
import xlrd | |
import argparse | |
import xml.etree.ElementTree as elementTree | |
import xml.dom.minidom as minidom | |
def parseExcelDoc(xlsFile, outputFile, useTableHeader): | |
print xlsFile |
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
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
typedef enum { | |
PXRPropSerializerTypeUnknown, | |
PXRPropSerializerTypeFloat, | |
PXRPropSerializerTypeDouble, | |
PXRPropSerializerTypeInt, | |
PXRPropSerializerTypeClass, | |
PXRPropSerializerTypeBool |
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
/* | |
Works with the alpha channel of an image to determine if there is collision with alpha | |
@parameter image - the image to check coordinate with. | |
@parameter sampling - (0.1-1.0) The percentage to downsample the image. Helps with performance and memory. Default 0.5 | |
@parameter threshhold - (0.0-1.0) the threshhold to set the alpha for a hit. default 0.2 | |
*/ | |
var PixelLevelCollision = function(image, sampling, threshhold){ | |
var self = this; | |
if(sampling === undefined){ |
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
#import <Foundation/Foundation.h> | |
@interface NSURLRequestFileInfo : NSObject | |
@property NSData *data; | |
@property NSString *name; | |
@property NSString *key; | |
+ (NSURLRequestFileInfo *)fileInfoWithData:(NSData *)data key:(NSString *)key andName:(NSString *)name; | |
@end | |
@interface NSURLRequest (FileAdditions) |
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/python | |
import os | |
import argparse | |
import xlrd | |
import json | |
def create_json_object(args): | |
workbook = xlrd.open_workbook(args.input) | |
sheet = workbook.sheet_by_index(0) | |
json_array = [] |
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
import Foundation | |
extension UIApplication { | |
var build: String { | |
return NSBundle.mainBundle().infoDictionary!["CFBundleVersion"] as! String | |
} | |
var version: String { | |
return NSBundle.mainBundle().infoDictionary!["CFBundleShortVersionString"] as! String |