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
# Add Git Repository as a subRepository | |
git submodule add git@mygithost:billboard lib/billboard |
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
// found in http://www.cocos2d-iphone.org/forum/topic/9138 | |
CGFloat GBDot(const CGPoint v1, const CGPoint v2) { | |
return v1.x*v2.x + v1.y*v2.y; | |
} | |
CGPoint GBSub(const CGPoint v1, const CGPoint v2) { | |
return CGPointMake(v1.x - v2.x, v1.y - v2.y); | |
} |
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
#!/bin/bash | |
# Found at http://gr3p.com/2012/06/encontrar-recursos-no-usados-en-un-proyecto-de-xcode | |
for i in `find . -name "*.png" -o -name "*.jpg"`; do | |
file=`basename -s .jpg "$i" | xargs basename -s .png | xargs basename -s @2x` | |
result=`ack -i "$file"` | |
if [ -z "$result" ]; then | |
echo "$i" | |
fi |
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
__attribute__ ((deprecated)) |
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
git init | |
git remote add origin https://github.com/username/Hello-World.git | |
#make some commits here | |
git push origin master |
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
-(NSString *) currentSong { | |
NSString *retVal = nil; | |
MPMusicPlayerController* iPodMusicPlayer = [MPMusicPlayerController iPodMusicPlayer]; | |
MPMediaItem *mediaItem = [iPodMusicPlayer nowPlayingItem]; | |
if (mediaItem) { | |
NSString *artist = [mediaItem valueForProperty: MPMediaItemPropertyArtist]; | |
NSString *song = [mediaItem valueForProperty: MPMediaItemPropertyTitle]; | |
retVal = [NSString stringWithFormat:@"NLT: %@ - %@", song, artist]; |
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
#GET | |
curl -HAccept:text/plain http://example.com/base | |
#PUT | |
curl -XPUT -HContent-type:text/plain --data "stuff:morestuff" http://example.com/base?param=val | |
#DELETE | |
curl -XDELETE http://example.com/base/user/123 | |
#POST |
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
// Image processing: creating CIImage | |
NSString *filename = [module.imageFilename stringByDeletingPathExtension]; | |
NSString *fileExtension = [module.imageFilename pathExtension]; | |
NSString *filePath = [[NSBundle mainBundle] pathForResource:filename ofType:fileExtension]; | |
NSURL *fileURL = [NSURL fileURLWithPath:filePath]; | |
CIImage *coreImage = [CIImage imageWithContentsOfURL:fileURL]; | |
CIContext *context = [CIContext contextWithOptions:nil]; | |
// Image processing: applying filter |
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
CGImageRef CGImageFromFile (NSString* path){ | |
// Get the URL for the pathname passed to the function. | |
NSURL *url = [NSURL fileURLWithPath:path]; | |
CGImageRef myImage = NULL; | |
CGImageSourceRef myImageSource; | |
CFDictionaryRef myOptions = NULL; | |
CFStringRef myKeys[2]; | |
CFTypeRef myValues[2]; | |
// Set up options if you want them. The options here are for |
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
// Needs CoreImage.framework | |
- (UIImage *)blurredImageWithImage:(UIImage *)sourceImage{ | |
// Create our blurred image | |
CIContext *context = [CIContext contextWithOptions:nil]; | |
CIImage *inputImage = [CIImage imageWithCGImage:sourceImage.CGImage]; | |
// Setting up Gaussian Blur | |
CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"]; |
OlderNewer