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
<?php | |
// not tested | |
// would go into your theme's functions.php | |
add_filter('ilab-imgix-filter-parameters',function($params, $size, $id, $meta){ | |
if (isset($meta['faces']) && is_array($meta['faces'])) { | |
$firstFace = $meta['faces'][0]; | |
$rect = $firstFace['BoundingBox']; | |
list($width, $height, $left, $top) = array_values($rect); | |
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
<?php | |
add_filter('ilab_imgix_filter_parameters',function($params, $size, $id, $meta){ | |
$params['blur'] = 20; | |
return $params; | |
}, 10, 4); |
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
#!/bin/bash | |
## combines multiple js files into main.js for deploying to parse | |
## Your separate js files should be in a directory 'source' that | |
## is at the same level as the 'cloud' and 'config' directories | |
## parse uses. | |
cat source/*.js > cloud/main.js | |
## deploy | |
parse deploy |
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
// | |
// SomeObject.h | |
// | |
#import <Cocoa/Cocoa.h> | |
@interface SomeObject { | |
NSString *title; | |
NSString *subtitle; | |
} |
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
-(NSImage *)getAnImage { | |
return [[[NSImage alloc] initWithContentsOfFile:@"/tmp/youownthis.jpg"] autorelease]; | |
} |
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
-(NSImage *)getAnImage { | |
return [[NSImage alloc] initWithContentsOfFile:@"/tmp/youownthis.jpg"]; | |
} |
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
// | |
// SomeObject.h | |
// | |
#import <Cocoa/Cocoa.h> | |
@interface SomeObject : NSObject { | |
NSMutableArray *things; | |
NSMutableDictionary *someOtherThings; | |
} |
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)sayWhat | |
{ | |
NSString *doIOwnThisIWonder = [NSString stringWithFormat:@"%@",@"Nope"]; | |
NSImage *iOwnThisImage = [[NSImage alloc] initWithContentsOfFile:@"/tmp/youownthis.jpg"]; | |
NSData *perhapsThisData=[iOwnThisImage TIFFRepresentation]; | |
... do my thing ... | |
[iOwnThisImage release]; | |
} |
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)sayWhat | |
{ | |
NSString *doIOwnThisIWonder = [NSString stringWithFormat:@"%@",@"Nope"]; | |
NSImage *iOwnThisImage = [[NSImage alloc] initWithContentsOfFile:@"/tmp/youownthis.jpg"]; | |
NSData *perhapsThisData=[iOwnThisImage TIFFRepresentation]; | |
} |
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)someMethod | |
{ | |
// I own this! | |
SomeObject *iOwnThis = [[SomeObject alloc] init]; | |
[iOwnThis doYourThing]; | |
// I release this! | |
[iOwnThis release]; | |
} |