Install the two dependencies, ImageMagick and Ghostscript.
$ brew install imagemagick
$ brew install ghostscript
CALayer *layer = self.nameLabel.layer; | |
layer.shadowColor = [UIColor blackColor].CGColor; | |
layer.shadowRadius = 3; | |
layer.shadowOpacity = 0.9; | |
layer.shadowOffset = CGSizeMake(0.2, 2); | |
layer.masksToBounds = NO; |
folder_path = "/Users/sundeepgupta/drive/tmp/sencha icons" | |
file_paths = Dir.glob(folder_path + "/*") | |
file_paths.each.with_index do |file_path, idx| | |
file_extension = File.extname(file_path) | |
new_file_path = "#{folder_path}/#{idx}#{file_extension}" | |
File.rename(file_path, new_file_path) | |
end |
cd ${SOURCE_ROOT}/${PROJECT_NAME} | |
# Installed via Homebrew | |
if [ -e /usr/local/bin/mogenerator ] | |
then | |
/usr/local/bin/mogenerator --template-var arc=true -m Model.xcdatamodeld/Model.xcdatamodel -M Models/Machine -H Models/Human | |
exit | |
fi | |
# Installed via .dmg |
#import "CCCardDetailTransitionAnimator.h" | |
- (void)prepareForCardDetailSequeWithCard:(CCCard *)card navigationController:(UINavigationController *)navigationController { | |
CCCardDetailViewController *destinationVc = (CCCardDetailViewController *)navigationController.viewControllers.firstObject; | |
[destinationVc configureWithCard:card delegate:self]; | |
navigationController.modalPresentationStyle = UIModalPresentationCustom; | |
navigationController.transitioningDelegate = self; | |
} |
CGImageRef imageRef = image.CGImage; | |
CGSize size = CGSizeMake(110, 110); //From storyboard. | |
CGRect frame = CGRectMake(0, 0, size.width, size.height); | |
CGContextRef context = CGBitmapContextCreate(nil, size.width, size.height, CGImageGetBitsPerComponent(imageRef), CGImageGetBytesPerRow(imageRef), CGImageGetColorSpace(imageRef), CGImageGetBitmapInfo(imageRef)); | |
CGContextSetInterpolationQuality(context, kCGInterpolationHigh); | |
CGContextDrawImage(context, frame, imageRef); | |
CGImageRef scaledImageRef = CGBitmapContextCreateImage(context); | |
UIImage *scaledImage = [UIImage imageWithCGImage:scaledImageRef]; |
import Foundation | |
public struct EmailMemory { | |
let memory: Memory | |
let email: String | |
let success: (() -> ()) | |
let failure: (NSError -> ()) | |
public init(memory: Memory, success: (() -> ()), failure: (NSError -> ())) { | |
self.memory = memory |
class BeaconIdGenerator | |
MAX_MAJOR_MINOR = 65536 | |
MAX_VALUE = MAX_MAJOR_MINOR**2 - 1 | |
def self.perform(value) | |
raise "Value passed in must be an integer." unless value.is_a? Integer | |
raise "Value passed in must be at least 0." if value < 0 | |
raise "Value passed in must be at most #{MAX_VALUE}" if value > MAX_VALUE | |
major = (value/MAX_MAJOR_MINOR).floor |
git branch -r | grep origin/release $1 | while read b; do t=${b:7}; git tag $t $b; done |
// | |
// ViewController.m | |
// Map Hacks | |
// | |
// Created by Ken Woo on 2016-02-02. | |
// Copyright © 2016 Lighthouse Labs. All rights reserved. | |
// | |
#import "ViewController.h" | |
#import <CoreLocation/CoreLocation.h> |