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
| // 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
| // 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
| // | |
| // Created by Danilo Priore on 18/08/12. | |
| // Copyright (c) 2012 Prioregroup.com. All rights reserved. | |
| // | |
| - (UIImage*)addTextToImage:(UIImage*)img text:(NSString*)text1 XPos:(int)xpos YPos:(int)ypos fontName:(NSString*)fontName fontSize:(CGFloat)fontSize fontColor:(UIColor*)fontColor { | |
| int w = img.size.width; | |
| int h = img.size.height; | |
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
| // generate random password from GUID | |
| string password = string.Empty; | |
| string guid = Guid.NewGuid().ToString().Replace("-", string.Empty); | |
| Random random = new Random(DateTime.Now.Millisecond); | |
| for (int i = 0; i < 8; i++) | |
| password += guid.Substring(random.Next(0, guid.Length - 1), 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
| // create a static class | |
| public static class DataReaderExtension | |
| { | |
| public static IEnumerable<Dictionary<string, object>> AsEnumerable(this System.Data.IDataReader source) | |
| { | |
| if (source == null) | |
| throw new ArgumentNullException("source"); | |
| while (source.Read()) | |
| { |
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 10/06/12. | |
| // Copyright 2012 Prioregroup.com. All rights reserved. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: |
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 Library for ASP.NET it's really simple to add a gift shop to your ASP.NET 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. | |
| // | |
| // look for source code : https://github.com/priore/MYZazzleStore-for-ASP.NET | |
| //ASP.NET page | |
| <%@ Register Assembly="Priore.Web.MYZazzleStore" |
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 SDK 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. | |
| MYZazzleStore myStore = [[MYZazzleStore alloc] initWithFrame:CGRectMake(0, 50, 320, 410)]; | |
| myStore.imageLink = @"http://www.my-domain.com/my-image.png"; | |
| // your Zazzle ID, this will allow you to earn referral on purchases (optional) | |
| myStore.accountId = 1234567890; | |
| [myStore reload]; |
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. | |
| -- Copyright (c) 2012 Prioregroup.com. All rights reserved. | |
| -- | |
| -- Permission is hereby granted, free of charge, to any person obtaining a copy | |
| -- of this software and associated documentation files (the "Software"), to deal | |
| -- in the Software without restriction, including without limitation the rights | |
| -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| -- copies of the Software, and to permit persons to whom the Software is | |
| -- furnished to do so, subject to the following conditions: |