Skip to content

Instantly share code, notes, and snippets.

@BrettBukowski
BrettBukowski / dabblet.css
Created February 1, 2012 20:31
Testing browsers' flickering doing a simple scale transition
/**
* Testing browsers' flickering doing a simple scale transition
*/
body {
background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAADHmlDQ1BJQ0MgUHJvZmlsZQAAeAGFVN9r01AU/tplnbDhizpnEQk+aJFuZFN0Q5y2a1e6zVrqNrchSJumbVyaxiTtfrAH2YtvOsV38Qc++QcM2YNve5INxhRh+KyIIkz2IrOemzRNJ1MDufe73/nuOSfn5F6g+XFa0xQvDxRVU0/FwvzE5BTf8gFeHEMr/GhNi4YWSiZHQA/Tsnnvs/MOHsZsdO5v36v+Y9WalQwR8BwgvpQ1xCLhWaBpXNR0E+DWie+dMTXCzUxzWKcECR9nOG9jgeGMjSOWZjQ1QJoJwgfFQjpLuEA4mGng8w3YzoEU5CcmqZIuizyrRVIv5WRFsgz28B9zg/JfsKiU6Zut5xCNbZoZTtF8it4fOX1wjOYA1cE/Xxi9QbidcFg246M1fkLNJK4RJr3n7nRpmO1lmpdZKRIlHCS8YlSuM2xp5gsDiZrm0+30UJKwnzS/NDNZ8+PtUJUE6zHF9fZLRvS6vdfbkZMH4zU+pynWf0D+vff1corleZLw67QejdX0W5I6Vtvb5M2mI8PEd1E/A0hCgo4cZCjgkUIMYZpjxKr4TBYZIkqk0ml0VHmyONY7KJOW7RxHeMlfDrheFvVbsrj24Pue3SXXjrwVhcW3o9hR7bWB6bqyE5obf3VhpaNu4Te55ZsbbasLCFH+iuWxSF5lyk+CUdd1NuaQU5f8dQvPMpTuJXYSWAy6rPBe+CpsCk+FF8KXv9TIzt6tEcuAcSw+q55TzcbsJdJM0utkuL+K9ULGGPmQMUNanb4kTZyKOfLaUAsnBneC6+biXC/XB567zF3h+rkIrS5yI47CF/VFfCHwvjO+Pl+3b4hhp9u+02TrozFa
@BrettBukowski
BrettBukowski / gist:2364068
Created April 12, 2012 01:15
Remove the huge whitespace from the Google redesign on 11 April 2012
.ncGWdc {
width: 76% !important;
}
.Te, .SG, .iH {
width: auto !important;
}
@BrettBukowski
BrettBukowski / gist:3296392
Created August 8, 2012 16:25
Classy browser update message
<!--[if IE 6]><marquee width=500 loop=1 behavior=slide>You're using an outdated browser. Please update.</marquee><![endif]-->
@BrettBukowski
BrettBukowski / gist:3296399
Created August 8, 2012 16:27
Add classes for specific version of IE
<!--[if IE 7]><html class="ie7"><![endif]-->
<!--[if IE 8]><html class="ie8"><![endif]-->
<!--[if gt IE 8]><!--><html><!--<![endif]-->
@BrettBukowski
BrettBukowski / gist:3375895
Created August 17, 2012 04:18
Display hex code for a UIColor
CGFloat red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0;
[someColor getRed:&red green:&green blue:&blue alpha:&alpha];
[someLabel setText:[NSString stringWithFormat:@"#%02X%02X%02X", (int) red * 255.0f, (int) green * 255.0f, (int) blue * 255.0f]];
@BrettBukowski
BrettBukowski / LaunchWebex.scpt
Created September 12, 2012 15:12
Automate launching Webex client thru Safari
on run argv
set location to "https://webexmeetingurl"
if length of argv > 0 then set location to item 1 of argv
tell application "System Events"
tell application "Safari" to activate
tell process "Safari"
click menu item "New Tab" of menu "File" of menu bar 1
end tell
end tell
@BrettBukowski
BrettBukowski / gist:3814745
Created October 1, 2012 22:03
Quick reflection for PHP classes
/**
* Provides quick reflection, usually so that the caller can access private
* methods and properies in a single pass.
*
* If called with a single String classname, then the \ReflectionClass of
* that class is returned.
* Accepts any number of additional Strings that are names of properties or
* methods to make accessible and return. Methods should be prefixed with 'method:'.
* The return value is an array containing the mapped reflection class and the properties / methods.
*
@BrettBukowski
BrettBukowski / gist:3909621
Created October 18, 2012 02:55
Poll the current interface orientation
[[UIApplication sharedApplication] statusBarOrientation]
@BrettBukowski
BrettBukowski / gist:3956617
Created October 26, 2012 02:46
Get the application frame, accounting for current interface orientation
+ (CGRect) currentApplicationFrame {
CGRect appFrame = [[UIScreen mainScreen] applicationFrame];
if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) {
return CGRectMake(0.0, 0.0, appFrame.size.height, appFrame.size.width);
}
return appFrame;
}
@BrettBukowski
BrettBukowski / gist:3984416
Created October 31, 2012 02:16
Apply mask for orientation change
// Apply a mask before rotating so that things aren't shifting around weirdly
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
CALayer *mask = [[CALayer alloc] init];
[mask setBounds:[[self view] bounds]];
[mask setContents:(__bridge id)[[UIColor darkGrayColor] CGColor]];
[[[self view] layer] setMask:mask];
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
// Remove mask