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
| git submodule foreach git submodule init && git submodule update --recursive |
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
| Here’s a handy checklist for setting up the connections between two scenes: | |
| 1. Create a segue from a button or other control on the source scene to the destination scene.* | |
| 2. Give the segue a unique Identifier.It only has to be unique in the source scene | |
| different scenes can use the same identifier. | |
| 3. Create a delegate protocol for the destination scene. | |
| 4. Call the delegate methods from the Cancel and Done buttons** |
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
| -(UIImage *)makeMirroredImage:(UIImage *)image | |
| { | |
| UIImageOrientation flippedOrientation = UIImageOrientationUpMirrored; | |
| switch (image.imageOrientation) { | |
| case UIImageOrientationDown: | |
| flippedOrientation = UIImageOrientationDownMirrored; | |
| break; | |
| case UIImageOrientationLeft: | |
| flippedOrientation = UIImageOrientationLeftMirrored; | |
| break; |
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
| for example, | |
| CGAffineTransformScale, not CGAffineTransformMakeScale | |
| CGAffineTransformRotate, not CGAffineTransformMakeRotate | |
| CGAffineTransformTranslate, not CGAffineTransformMakeTranslate |
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
| """ | |
| This provides a simple implementation of the 'Chaocipher' encryption | |
| algorithm described at: | |
| http://www.ciphermysteries.com/2010/07/03/the-chaocipher-revealed | |
| Example usage: | |
| import chaocipher | |
| sender = chaocipher.Wheels(CtWheel='QYNBOWTGIRJFEPKLSDMAVZCUXH', PtWheel='JGUACNQLTDHKSOPZFYMXWRVEBI') | |
| receiver = chaocipher.Wheels(CtWheel='QYNBOWTGIRJFEPKLSDMAVZCUXH', PtWheel='JGUACNQLTDHKSOPZFYMXWRVEBI') | |
| cyphertext = sender.encipher("Green eggs and spam") |
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
| # ChaoSim.pl : Simulation of Chaocipher enciphering/deciphering | |
| # (c) Moshe Rubin, August 2010 | |
| # email: mosher@mountainvistasoft.com | |
| use strict; | |
| use diagnostics; | |
| use warnings; | |
| my $left = uc($ARGV[1]); | |
| my $right = uc($ARGV[2]); | |
| my $mode = $ARGV[3]; |
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
| CGDataRef imageDataRef = CGDataProviderCopyData(CGImageGetDataProvider(myCGImageRef))); | |
| // CGDataProviderCopyData copies underlying bytes |
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
| // How to draw shadowed text | |
| // color = [[UIColor orangeColor] CGColor]; best to cache this | |
| CGContextSaveGState(context); | |
| CGFloat shadowHeight = 2.0; | |
| CGContextSetShadowWithColor(context, CGSizeMake(1.0, -shadowHeight), 0.0, <color>); | |
| [<string>, drawInRect:<rect> withFont:<font>]; | |
| CGContextRestoreGState(context); |
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
| // Core Animation Example: eggs falling out of a tree | |
| // This was glommed from iphonedevsdk: http://www.iphonedevsdk.com/forum/iphone-sdk-development/65632-animation-sample-code-our-newest-app.html | |
| // This is the main animation routine. | |
| - (IBAction) doorEasterEggAction; | |
| { | |
| //treeDoorImageView | |
| CATransform3D theTransform; | |
| UIImageView* anEgg; |
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
| // iOS: Generating random, non-repeating text | |
| /* | |
| Selects random words or phrases from an array, and only select any given word/phrase once. | |
| To use it: | |
| -Create a file called words.txt containing a list of words or phrases separated by carriage returns. | |
| -Drag that file into the resources portion of your project, so it will be included in the bundle. | |
| -Call [self buildRandomWordArray] to do the initial setup. That reads the file and populates an array of random indexes. |