Skip to content

Instantly share code, notes, and snippets.

@jallen
jallen / flatcolors.com.swedish.sketchpalette
Created October 11, 2019 15:16
Sketch Color Palette for the Flatcolors.com Swedish palette
{
"compatibleVersion": "2.0",
"pluginVersion": "2.22",
"colors": [{
"name": null,
"red": 0.9372549019607843,
"green": 0.3411764705882353,
"blue": 0.4666666666666667,
"alpha": 1
}, {

Keybase proof

I hereby claim:

  • I am jallen on github.
  • I am jaredallen (https://keybase.io/jaredallen) on keybase.
  • I have a public key whose fingerprint is 464B BC29 27B6 F075 885E 2D94 1B28 7E38 386B 77CA

To claim this, I am signing this object:

@jallen
jallen / mopub-ios-sdk.podspec.json
Created March 11, 2015 20:01
mopub-ios-sdk 3.5 with Facebook subspec.
{
"name": "mopub-ios-sdk",
"version": "3.5.0",
"summary": "The Official MoPub Client SDK allows developers to easily monetize their apps by showing banner, interstitial, and native ads.",
"description": " MoPub is a hosted ad serving solution built specifically for mobile publishers.\n Grow your mobile advertising business with powerful ad management, optimization \n and reporting capabilities, and earn revenue by connecting to the world's largest \n mobile ad exchange. \n\n To learn more or sign up for an account, go to http://www.mopub.com. \n",
"homepage": "https://github.com/mopub/mopub-ios-sdk",
"license": {
"type": "New BSD",
"file": "LICENSE"
},
@jallen
jallen / mopub-ios-sdk.podspec.json
Last active September 18, 2015 12:38
Fix circular dependency in mopub-ios-sdk
{
"name": "mopub-ios-sdk",
"version": "3.1.0",
"summary": "The Official MoPub Client SDK allows developers to easily monetize their apps by showing banner, interstitial, and native ads.",
"description": " MoPub is a hosted ad serving solution built specifically for mobile publishers.\n Grow your mobile advertising business with powerful ad management, optimization \n and reporting capabilities, and earn revenue by connecting to the world's largest \n mobile ad exchange. \n\n To learn more or sign up for an account, go to http://www.mopub.com. \n",
"homepage": "https://github.com/mopub/mopub-ios-sdk",
"license": {
"type": "New BSD",
"file": "LICENSE"
},
static CIImage* ApplyFiltersToImage(NSArray *filters, CIImage *inputImage)
{
CIImage *img = inputImage;
for (CIFilter *filter in filters)
{
[filter setValue:img forKey:kCIInputImageKey];
img = filter.outputImage;
}
return img;
}
@jallen
jallen / gist:22edd22046550a5ffebd
Created May 16, 2014 21:29
Calculate initial zoomScale and contentOffset for an ALAsset sized to fit and centered for a given screenSize
- (CGFloat)_initialZoomScaleForAsset:(ALAsset *)asset screenSize:(CGSize)screenSize {
CGSize scaledSize = [AssetWorker scaledSizeForImageSize:asset.defaultRepresentation.dimensions];
CGFloat xScale = screenSize.width / scaledSize.width; // the scale needed to perfectly fit the image width-wise
CGFloat yScale = screenSize.height / scaledSize.height; // the scale needed to perfectly fit the image height-wise
return MAX(xScale, yScale);
}
- (CGPoint)_initialContentOffsetForAsset:(ALAsset *)asset screenSize:(CGSize)screenSize {
CGSize scaledSize = [AssetWorker scaledSizeForImageSize:asset.defaultRepresentation.dimensions];
CGFloat zoomScale = [self _initialZoomScaleForAsset:asset screenSize:screenSize];
@jallen
jallen / gist:4264455
Created December 12, 2012 02:53
Drop Shadow on UIView using Quartz
#import <QuartzCore/QuartzCore.h>
UIView *shadowView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, screenWidth, screenWidth)];
shadowView.layer.shadowColor = [UIColor blackColor].CGColor;
shadowView.layer.shadowOpacity = 0.5;
shadowView.layer.shadowOffset = CGSizeMake(0, 2);
shadowView.layer.shadowPath = [UIBezierPath bezierPathWithRect:shadowView.frame].CGPath;
shadowView.layer.shadowRadius = 2.0f;
shadowView.layer.masksToBounds = NO;
[self.view addSubview:shadowView];