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)dropItBack:(id)sender | |
| { | |
| // Position | |
| CABasicAnimation *posAnimation = [CABasicAnimation animationWithKeyPath:@"position"]; | |
| posAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(self.center.x, self.center.y - 50.f)]; | |
| // Opacity | |
| CABasicAnimation *opacityAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; | |
| opacityAnimation.toValue = [NSNumber numberWithFloat:0.5f]; |
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
| function custom_query() { | |
| // args | |
| $args = array( | |
| 'numberposts' => -1, | |
| 'post_type' => 'artists', | |
| 'meta_query' => array( | |
| 'relation' => 'AND', | |
| array( | |
| 'key' => 'surname', | |
| 'value' => 'Blow', |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| <!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices (57x57): --> | |
| <link rel="apple-touch-icon-precomposed" href="<?php echo get_template_directory_uri(); ?>/library/images/favicons//icon-57.png"> | |
| <!-- For the iPad mini and the first- and second-generation iPad on iOS ≤ 6: --> | |
| <link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php echo get_template_directory_uri(); ?>/library/images/favicons//icon-72.png"> | |
| <!-- For the iPad mini and the first- and second-generation iPad on iOS ≥ 7: --> | |
| <link rel="apple-touch-icon-precomposed" sizes="76x76" href="<?php echo get_template_directory_uri(); ?>/library/images/favicons//icon-76.png"> | |
| <!-- For iPhone with high-resolution Retina display running iOS ≤ 6: --> | |
| <link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php echo get_template_directory_uri(); ?>/library/images/favicons//icon-114.png"> | |
| <!-- For iPhone with high-resolution Retina display running iOS ≥ 7: --> | |
| <link rel="apple-touch-icon-precomposed" sizes="120x120" href="<?php echo |
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
| <!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices (57x57): --> | |
| <link rel="apple-touch-icon-precomposed" href="icons/icon-57.png"> | |
| <!-- For the iPad mini and the first- and second-generation iPad on iOS ≤ 6: --> | |
| <link rel="apple-touch-icon-precomposed" sizes="72x72" href="icons/icon-72.png"> | |
| <!-- For the iPad mini and the first- and second-generation iPad on iOS ≥ 7: --> | |
| <link rel="apple-touch-icon-precomposed" sizes="76x76" href="icons/icon-76.png"> | |
| <!-- For iPhone with high-resolution Retina display running iOS ≤ 6: --> | |
| <link rel="apple-touch-icon-precomposed" sizes="114x114" href="icons/icon-114.png"> | |
| <!-- For iPhone with high-resolution Retina display running iOS ≥ 7: --> | |
| <link rel="apple-touch-icon-precomposed" sizes="120x120" href="icons/icon-120.png"> |
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
| <!DOCTYPE html> | |
| <html lang=en> | |
| <head> | |
| <title>Page Title</title> | |
| <script src='//ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js' type='text/javascript'></script> | |
| <script src="javascript.js"></script> | |
| <link rel="stylesheet" type="text/css" href="style.css"> | |
| </head> | |
| <body> |
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
| $start_date = new DateTime('2007-09-01 04:10:58'); | |
| $since_start = $start_date->diff(new DateTime('2012-09-11 10:25:00')); | |
| echo $since_start->days.' days total<br>'; | |
| echo $since_start->y.' years<br>'; | |
| echo $since_start->m.' months<br>'; | |
| echo $since_start->d.' days<br>'; | |
| echo $since_start->h.' hours<br>'; | |
| echo $since_start->i.' minutes<br>'; | |
| echo $since_start->s.' seconds<br>'; |
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
| CABasicAnimation *rotation; | |
| rotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; | |
| rotation.fromValue = [NSNumber numberWithFloat:0]; | |
| rotation.toValue = [NSNumber numberWithFloat:((360*M_PI)/180)]; | |
| rotation.duration = 60.0f; | |
| rotation.repeatCount = HUGE_VALF; | |
| UIView *myview = [[UIView alloc] init]; | |
| [self.view addSubview:myview]; | |
| [myview setBackgroundColor:[UIColor orangeColor]]; |
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)panLeftRight:(id)sender { | |
| CGFloat autoLayoutConstant = _keyboardAuto.centerKeyboardConstraint.constant; | |
| CGFloat panableKeyboardSize = [_keyboardAuto panableKeyBoardSize]; | |
| CGFloat frameWidth = _keyboardAuto.frame.size.width; | |
| CGFloat lowerLimit = -panableKeyboardSize/2 + frameWidth/2; | |
| CGFloat upperLimit = panableKeyboardSize/2 - frameWidth/2; | |
| UIPanGestureRecognizer *pgr = (UIPanGestureRecognizer *)sender; | |
| CGPoint translation = [pgr translationInView:pgr.view]; |
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)showPopupButton { | |
| // no need for two CALayers here. Originally intended for UIView but works fine with UIButton | |
| UIButton *myButton = [[UIButton alloc] initWithFrame:CGRectMake(10, 10, CGRectGetMaxX(self.view.bounds)-20, 100)]; | |
| [myButton setBackgroundColor:[UIColor orangeColor]]; | |
| [myButton addTarget:self action:@selector(newButtonPressed) forControlEvents:UIControlEventTouchUpInside]; | |
| [myButton.layer setCornerRadius:10.0]; | |
| [self.view addSubview:myButton]; | |
| CALayer *outerLayer = [CALayer layer]; | |
| CATextLayer *innerLayer = [CATextLayer layer]; |
NewerOlder