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
// TextView subclass that replicates TVOS movies app | |
// Also made a quick presentation controller | |
// Just connect the delegate to the ViewController in IB | |
// and set the TextView class to FocusTextView | |
import UIKit | |
class TextPresentationViewController:UIViewController { | |
let label = UILabel() | |
let blurStyle = UIBlurEffectStyle.Dark |
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
public class MainActivity extends AppCompatActivity { | |
Retrofit retrofit; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
/* | |
Rest | |
*/ |
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
0x5C181633491545D23DBF9439B5875f1bf0c716c7 |
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
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
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
post_install do |installer| | |
installer.pods_project.targets.each do |target| | |
target.build_configurations.each do |config| | |
config.build_settings['SWIFT_VERSION'] = '2.3' | |
end | |
end | |
end |
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 UIView (SMFrameAdditions) | |
@property (nonatomic, assign) CGPoint $origin; | |
@property (nonatomic, assign) CGSize $size; | |
@property (nonatomic, assign) CGFloat $x, $y, $width, $height; // normal rect properties | |
@property (nonatomic, assign) CGFloat $left, $top, $right, $bottom; // these will stretch the rect | |
@end |
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
Class MKMapItemClass = [MKMapItem class]; | |
if (MKMapItemClass && [MKMapItemClass respondsToSelector:@selector(openMapsWithItems:launchOptions:)]) { | |
CLLocationCoordinate2D endCoord = { 54.0696, 50.3616 }; | |
MKPlacemark *endLocation = [[MKPlacemark alloc] initWithCoordinate:endCoord addressDictionary:nil]; | |
MKMapItem *endingItem = [[MKMapItem alloc] initWithPlacemark:endLocation]; | |
NSMutableDictionary *launchOptions = [[NSMutableDictionary alloc] init]; | |
[launchOptions setObject:MKLaunchOptionsDirectionsModeDriving forKey:MKLaunchOptionsDirectionsModeKey]; | |
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
ACAccountStore *store = [[ACAccountStore alloc] init]; | |
ACAccountType *facebookAccountType = [store accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook]; | |
NSDictionary *FacebookOptions = @{ACFacebookAppIdKey: @"XXXXXXXXXX",ACFacebookPermissionsKey: @[@"email"],ACFacebookAudienceKey:ACFacebookAudienceEveryone}; | |
[store requestAccessToAccountsWithType:facebookAccountType options:FacebookOptions completion:^(BOOL granted, NSError *error) { | |
if (granted) | |
{ | |
NSArray *accounts = [store accountsWithAccountType:facebookAccountType]; | |
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
# Mac OS X | |
*.DS_Store | |
# Xcode | |
*.pbxuser | |
*.mode1v3 | |
*.mode2v3 | |
*.perspectivev3 | |
*.xcuserstate | |
project.xcworkspace/ |
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
CALayer *viewLayer = UIVIEW.layer; | |
CAGradientLayer *gradientLayerView = [[CAGradientLayer alloc] init]; | |
[gradientLayerView setFrame:[UIVIEW frame]]; | |
[gradientLayerView setPosition:CGPointMake(UIVIEW.frame.size.width / 2, UIVIEW.frame.size.height / 2)]; | |
[gradientLayerView setMasksToBounds:NO]; | |
[gradientLayerView setColors:[NSArray arrayWithObjects: | |
(id)[[UIColor colorWithWhite:0.0 alpha:1.0] CGColor], | |
(id)[[UIColor colorWithWhite:0.0 alpha:0.0] CGColor], nil]]; | |
[gradientLayerView setStartPoint:CGPointMake(0.5, 0.92)]; |