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
| // get file list with NSPredicate | |
| NSString *bundlePath = [[NSBundle mainBundle] bundlePath]; | |
| NSFileManager *fm = [NSFileManager defaultManager]; | |
| NSArray *dirContents = [fm contentsOfDirectoryAtPath:bundlePath error:nil]; | |
| NSPredicate *fltr = [NSPredicate predicateWithFormat:@"self like '*.jpeg'"]; | |
| NSArray *fileNames = [[dirContents filteredArrayUsingPredicate:fltr] retain]; |
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
| // Facebook Token to exchange app information. | |
| // Can use the token to authenticate an application for a web service. | |
| // | |
| // Created by Danilo Priore on 27/11/12. | |
| + (NSString*)getAppAccessTokenWithAppId:(NSString*)appId cosumerSecret:(NSString*)secret | |
| { | |
| // get application access token | |
| NSString *link = [NSString stringWithFormat:@"https://graph.facebook.com/oauth/access_token?client_id=%@&client_secret=%@&grant_type=client_credentials", appId, secret]; | |
| NSURL *url = [NSURL URLWithString:link]; |
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
| # Convert picture in to Objctive-C source code. | |
| # for example, to include an image in a static library. | |
| # original post : http://t.co/JqZmPyg4 @adnanced | |
| # | |
| # First step : | |
| # 1. Create a text file named pic2code.sh, and save it in your Documents folder. | |
| # 2. In the content of new text file, write script below: | |
| #!/bin/sh | |
| echo "// Byte array generated from file $1" |
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
| // updated: 03-04-2013 | |
| // | |
| using System.Web; | |
| public static class Mashape // www.mashape.com/priore | |
| { | |
| private static string[] VALID_MASHAPE_ADDR = new string[] { "23.21.64.131", "23.21.68.63", "23.23.86.71", "23.23.87.232", "23.23.103.203", "23.23.103.204", "23.23.103.207", "23.23.103.212", "23.23.103.218", "50.17.255.165" }; | |
| public static bool IsValidSecretCode(string secret_code) |
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 fix GameCenter Leaderboard in Landscape mode | |
| // with Cocos2d v.2.0 and iOS6. | |
| // | |
| // Author: Danilo Priore | |
| // http://www.prioregroup.com | |
| // | |
| // 1. Create a personalized UINavigationController | |
| // | |
| // GameNavigationController.h | |
| @interface GameNavigationController : UINavigationController |
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
| // | |
| // Created by Danilo Priore on 20/02/13. | |
| // www.prioregroup.com | |
| // | |
| // CCLayer+GoogleAnalytics.h | |
| #import "CCLayer.h" | |
| @interface CCLayer (GoogleAnalytics) | |
| @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
| // With MYZazzleStore service it's really simple to add a gift shop to your application for your users. | |
| // With a few lines of code you can give your users the opportunity to purchase T-shirts personalized | |
| // mugs, iphone / ipad covers and other types of gifts. It also allows you to increase financial gains | |
| // and increase the popularity of your products. | |
| // | |
| // Is really very simple to add to your application a gift shop to offer your users. | |
| // With few lines of code you can give your users the opportunity to purchase T-shirts personalized | |
| // mugs, iphone / ipad cover and other types of gifts, also allowing you to add a further financial | |
| // gain and increasing the popularity of your products. | |
| // |
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
| - (void)webViewHideBackgroundAndScrollBar:(UIWebView*)theView { | |
| theView.opaque = NO; | |
| theView.backgroundColor = [UIColor clearColor]; | |
| for(UIView *view in theView.subviews) { | |
| if ([view isKindOfClass:[UIImageView class]]) { | |
| // to transparent | |
| [view removeFromSuperview]; | |
| } | |
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 do I sync files between computers ? (WIN, MAC, LINUX) | |
| Syncing your files between all of your computers, smartphones, and tablets is what Dropbox is all about. All you have to do is install the Dropbox desktop application and sign in using the same login. | |
| If you've already installed Dropbox, simply adding files to your Dropbox folder will automatically sync the file to your Dropbox, which means you can open it from any other computer, smartphone, or tablet that also has Dropbox installed. | |
| If you'd rather sync some files with other people on other Dropbox accounts, that's easy too; just create a shared folder instead. | |
| Install the Dropbox app from http://db.tt/XLEtgM7 |
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
| - (NSString*)removeUnusedCharacters:(NSString*)input | |
| { | |
| NSCharacterSet *doNotWant = [NSCharacterSet characterSetWithCharactersInString:@"ÀÁÂÃÄâãäàÈÉÊËêëÌÍÎÏîïíÒÓÔÕÖôõöóÙÚÛÜûüùÝýñ\\|!\"£$%&/=?^+*°#§;:_`«“‘¥~‹÷´`≠¡ˆ„Ω€®™æ¨œøπ[]åß∂ƒ∞∆ªº¬@¶≤≥<>∑†©√∫˜µ…•–◊{}±¿≈⁄›‰¢’”»ı³"]; | |
| return [[[input componentsSeparatedByCharactersInSet: doNotWant] componentsJoinedByString: @""] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; | |
| } |