Skip to content

Instantly share code, notes, and snippets.

View lappp9's full-sized avatar

Luke Parham lappp9

View GitHub Profile
@lappp9
lappp9 / about.md
Created August 9, 2011 20:57 — forked from blaix/about.md
Programming Achievements: How to Level Up as a Developer

Programming Achievements: How to Level Up as a Developer

  1. Select a particular experience to pursue.
  2. Pursue that experience to completion. (Achievement unlocked!)
  3. Reflect on that experience. Really soak it in. Maybe a blog post would be in order?
  4. Return to Step 1, this time selecting a new experience.

This gist is a fork of the gist from this blog post.

:convert_options => { thumb: "-interlace Plane" }
:convert_options => {
:medium => "-quality 80 -interlace Plane",
:thumb => "-quality 80 -interlace Plane"
}
@lappp9
lappp9 / nodes.mm
Created February 27, 2016 22:59
Async Example
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
_imageNode = [[ASNetworkImageNode alloc] init];
_imageNode.defaultImage = [UIImage imageNamed:@"lightGrayPlaceholder"];
_imageNode.frame = CGRectMake(0, 0, _screenWidth - 2, _screenHeight * (5.0/12.0));
_imageNode.cornerRadius = 2;
_imageNode.delegate = self;
dispatch_async(dispatch_get_main_queue(), ^{
[self.view addSubview:_imageNode.view];
});
@lappp9
lappp9 / multiplex.mm
Last active May 30, 2016 18:31
MutliplexImageNode Example
- (instancetype)initWithURLs:(NSDictionary *)urls
{
_imageUrls = urls; // something like @{@"thumb": "/smallImageUrl", @"/medium": ...}
_multiplexImageNode = [[ASMultiplexImageNode alloc] initWithCache:nil downloader:[[ASBasicImageDownloader alloc] init]];
_multiplexImageNode.downloadsIntermediateImages = YES;
_multiplexImageNode.imageIdentifiers = @[ @"original", @"medium", @"thumb" ];
}
NSString *filename = [[NSBundle mainBundle] pathForResource:@“fileName.png” ofType:nil];
if (filename) {
[UIImage imageWithContentsOfFile:filename];
}
CALayer *layer = [[CALayer alloc] init];
layer.shadowColor = [UIColor purpleColor].CGColor;
layer.shadowOpacity = 0.5;
layer.shadowRadius = 5.0;
layer.shadowOffset = CGSizeMake(1.0, 1.0);
layer.shadowPath = CGPathCreateWithRect(layer.bounds, NULL);
int *array = (int *)calloc(1, sizeof(int) * 2);
printf("The initial arrays location is %p\n", array);
array[1] = 777;
int size = sizeof(array)/sizeof(array[0]);
for(int i = 0; i < size; i++) {
printf("%d ", array[i]); // show the array
}
printf("\n");