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
Travis Swicegood is a professional programmer and owner of Domain51, a web development company with a focus on non-profits, NGOs, and online activists. He doesn't change the world, he supports those who do. | |
He has personal a focus on web applications, performance, and stability; is author of Pragmatic Version Control using Git; and working on his second book. He has been using PHP; since '99 and still remembers how revolutionary PHP 4 was, but can't remember why. He's a TDD, open-source, and open government advocate—sometimes called a zealot—and lurker on many an open-source project mailing list when not learning other programming; languages; for fun, exploring his surroundings on bike, or tasting his latest kitchen and home-brew creations. |
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
button.red { height: 2.5em; padding: 0px 2em; padding-bottom: 2px; | |
color: #fff; font-size: 15px; font-family: "Lucida Grande",Helvetica,Arial,sans-serif; text-shadow: -1px -1px 0px #aaa; cursor: pointer; | |
background: #e22525; background: #e22525 -webkit-gradient(linear, left top, left bottom, from(#e22525), to(#e27676)); | |
filter: progid:DXImageTransform.Microsoft.Gradient(startColorstr=#e22525, endColorstr=#e27676, gradientType=0); | |
-moz-border-radius: 4px; | |
-webkit-border-radius: 4px; | |
border: 2px solid #aaa; margin-left: auto; margin-right: auto; } |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10"> | |
<data> | |
<int key="IBDocument.SystemTarget">1056</int> | |
<string key="IBDocument.SystemVersion">10H574</string> | |
<string key="IBDocument.InterfaceBuilderVersion">823</string> | |
<string key="IBDocument.AppKitVersion">1038.35</string> | |
<string key="IBDocument.HIToolboxVersion">461.00</string> | |
<object class="NSMutableDictionary" key="IBDocument.PluginVersions"> | |
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
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
BOOL colorSimilarToColor(UIColor *left, UIColor *right) { | |
float tolerance = 0.05; // 5% | |
CGColorRef leftColor = [left CGColor]; | |
CGColorRef rightColor = [right CGColor]; | |
if (CGColorGetColorSpace(leftColor) != CGColorGetColorSpace(rightColor)) { | |
return FALSE; | |
} | |
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
<?xml version="1.0" encoding="utf-8"?> | |
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:s="library://ns.adobe.com/flex/spark" | |
xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:feeds="services.feeds.*" addedToStage="getFeed()"> | |
<fx:Script> | |
<![CDATA[ | |
import mx.controls.Alert; | |
protected function getFeed():void | |
{ |
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) imageLoaded:(NSData *) data { | |
// data contains the data loaded from the web, | |
// or Nil in the event of an error | |
} |
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) queueDownloadFromURL:(NSURL *) url | |
withHTTPParameters:(NSDictionary *) parameters | |
target:(id) target | |
selector:(SEL) selector | |
atTopOfQueue:(BOOL) atTopOfQueue; |
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
protected function fitImagesInClientArea():void { | |
// Create the main bin | |
var bins:Array = [new Bin(width, 0)]; | |
// Sort the images | |
boxes.sort(function(a:Box, b:Box):int { | |
if (a.width > b.width) { |
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
protected var binContainer:Array = []; | |
protected function getBinContainerAtIndex(index:int):HBox { | |
while (index >= binContainer.length) { | |
var hbox:HBox = new HBox(); | |
hbox.percentWidth = 100; | |
hbox.height = 150; | |
addChild(hbox); | |
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
protected function fitImagesInClientArea():void { | |
// Create the main bin | |
var bins:Array = [new Bin(0, 0, width, height)]; | |
// Sort the images | |
boxes.sort(function(a:Box, b:Box):int { | |
if (a.area > b.area) { |