Skip to content

Instantly share code, notes, and snippets.

View tmdvs's full-sized avatar
🔆
making cool stuff with cool people

Tim Davies tmdvs

🔆
making cool stuff with cool people
View GitHub Profile
- (void) didRotate:(UIRotationGestureRecognizer *)sender
{
rotation = (rotation + [sender rotation]);
rotationTransform = CGAffineTransformMakeRotation(rotation);
[[self view] setTransform:rotationTransform];
}
@tmdvs
tmdvs / gist:869789
Created March 14, 2011 20:20
Using CALayers for dynamic shadows
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];
@implementation UIApplication(Retina)
- (BOOL) deviceIsRetina
{
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] == YES && [[UIScreen mainScreen] scale] == 2.00) {
// RETINA DISPLAY
return YES;
}
else
{
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\]\$ '
console.log($(this, 'input[name=basket_item\[product_id\]]').val());