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
console.log($(this, 'input[name=basket_item\[product_id\]]').val()); |
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
PS1='\[\033[00;32m\]\u\[\033[01m\]@\[\033[00;36m\]\h\[\033[01m\]:\[\033[00;35m\]\w\[\033[00m\]\[\033[0;37m\](`git branch 2>/dev/null|tr -d \*\ `)\[\033[00m\]\$ ' |
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
@implementation UIApplication(Retina) | |
- (BOOL) deviceIsRetina | |
{ | |
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] == YES && [[UIScreen mainScreen] scale] == 2.00) { | |
// RETINA DISPLAY | |
return YES; | |
} | |
else | |
{ |
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
UIView *myView = [[UIView alloc] initWithFrame:CGRectMake(30, 30, 260, 260)]; | |
/* It's important to remember to pass CG structs like floats and CGColors */ | |
[[myView layer] setShadowOffset:CGSizeMake(0, 1)]; | |
[[myView layer] setShadowColor:[[UIColor darkGrayColor] CGColor]]; | |
[[myView layer] setShadowRadius:3.0]; |
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) didRotate:(UIRotationGestureRecognizer *)sender | |
{ | |
rotation = (rotation + [sender rotation]); | |
rotationTransform = CGAffineTransformMakeRotation(rotation); | |
[[self view] setTransform:rotationTransform]; | |
} |
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) didRotate:(UIRotationGestureRecognizer *)sender | |
{ | |
CGAffineTransform original = [[self view] transform]; | |
CGAffineTransform newTransform = CGAffineTransformMakeRotation([sender rotation]); | |
[[self view] setTransform:CGAffineTransformConcat(original, newTransform)]; | |
[sender setRotation:0]; | |
} |
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
-- | |
-- Constraints for table `roles_users` | |
-- | |
ALTER TABLE `roles_users` | |
ADD CONSTRAINT `roles_users_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, | |
ADD CONSTRAINT `roles_users_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE; | |
-- | |
-- Constraints for table `user_tokens` | |
-- |
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
CALayer *myLayer = [CALayer layer]; | |
[myLayer setFrame:rect]; | |
[myLayer setBackgroundColor:[myColour CGColor]]; | |
[myLayer setCornerRadius:radius]; | |
UIGraphicsBeginImageContext([myLayer frame].size); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
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
CALayer *myLayer = [CALayer layer]; | |
[myLayer setFrame:rect]; | |
[myLayer setBackgroundColor:[myColour CGColor]]; | |
[myLayer setCornerRadius:radius]; | |
UIGraphicsBeginImageContext([myLayer frame].size); | |
CGContextRef context = UIGraphicsGetCurrentContext(); |
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
#define UILoremIpsum [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"filltext" ofType:@"txt"] encoding:NSUTF8StringEncoding error:nil] |
OlderNewer