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
{ | |
"USA" : { | |
"AZ" : ["Phoenix", "Tucson"], | |
"CA" : ["Fresno", "Inland Empire", "Los Angeles", "Modesto", "Orange County", "Sacramento", | |
"San Diego", "San Francisco", "Santa Barbara", "Silicon Valley"], | |
"CO" : ["Colorado Springs", "Denver"], |
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
#pragma mark - Hide and Show | |
#pragma mark - | |
- (void)prepareAnimationForNavigationBarWithDuration:(CGFloat)duration { | |
// prepare animation for navigation bar | |
CATransition *animation = [CATransition animation]; | |
[animation setDuration:duration]; | |
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; | |
[animation setType:kCATransitionFade]; | |
[self.navigationController.navigationBar.layer addAnimation:animation forKey:nil]; |
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
var isMobile = { | |
Android: function() { | |
return /Android/i.test(navigator.userAgent); | |
}, | |
BlackBerry: function() { | |
return /BlackBerry/i.test(navigator.userAgent); | |
}, | |
iOS: function() { | |
return /iPhone|iPad|iPod/i.test(navigator.userAgent); | |
}, |
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
<html><head><title>MyApp Redirect</title></head> | |
<script type="text/javascript"> | |
var isAndroid = /Android/i.test(navigator.userAgent); | |
var isiOS = /iPhone|iPad|iPod/i.test(navigator.userAgent); | |
if (isiOS) { | |
location.href = "https://itunes.apple.com/us/app/myapp/id99999999?mt=8"; | |
} | |
else if (isAndroid) { | |
location.href = "https://play.google.com/store/apps/details?id=com.myapp.myapp"; |
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
$(function() { | |
var gistPrefix = 'https://gist.github.com/'; | |
var embedGists = function() { | |
$('a[href^="' + gistPrefix + '"]').each(function(index, anchor) { | |
var href = $(anchor).attr('href'); | |
var gistId = href.substring(gistPrefix.length); | |
var url = gistPrefix + gistId + '.json?callback=?'; | |
$.getJSON(url, function(gistData) { |
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
#import <UIKit/UIKit.h> | |
@interface BaseViewController : UIViewController | |
#pragma mark - Keyboard Methods | |
#pragma mark - | |
- (void)hideKeyboardWithoutAnimation; | |
- (void)keyboardWillShowWithHeight:(CGFloat)height duration:(CGFloat)duration animationOptions:(UIViewAnimationOptions)animationOptions; | |
- (void)keyboardWillHideWithHeight:(CGFloat)height duration:(CGFloat)duration animationOptions:(UIViewAnimationOptions)animationOptions; |
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 a shadow | |
UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRect:view.bounds]; | |
view.layer.masksToBounds = NO; | |
view.layer.shadowColor = [UIColor blackColor].CGColor; | |
view.layer.shadowOffset = CGSizeMake(0.0f, 5.0f); | |
view.layer.shadowOpacity = 0.45f; | |
view.layer.shadowRadius = 10.0f; | |
view.layer.shadowPath = shadowPath.CGPath; |
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
@implementation TappableTextView | |
- (instancetype)init { | |
self = [super init]; | |
if (self) { | |
[self setup]; | |
} | |
return self; | |
} |
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/sh | |
# Note: Be sure to set BITLY_LOGIN and BITLY_APIKEY in .bash_profile | |
# .bash_profile | |
# | |
# export BITLY_LOGIN=REPLACE_WITH_LOGIN | |
# export BITLY_APIKEY=REPLACE_WITH_KEY | |
# | |
# Then run "source ~/.bash_profile" to update your current shell. |
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
appBuild=`date "+%Y.%m.%d.%H%M%S"` | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $appBuild" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
echo "Updated ${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" |