Skip to content

Instantly share code, notes, and snippets.

View sophistifunk's full-sized avatar

Josh McDonald sophistifunk

  • Expantra
  • Brisbane, Australia
View GitHub Profile
@sophistifunk
sophistifunk / make-ios-icons.rb
Created July 2, 2012 10:29
Create a bunch of resized icons for iOS projects
#!/usr/bin/ruby
# Takes one large image (say, 512 or 1024 px) and creates some iOS icons:
#
# Icon-72.png
# Icon-Small-50.png
# Icon-Small.png
# [email protected]
# Icon.png
# [email protected]
@sophistifunk
sophistifunk / findInHavingOf.as
Created May 19, 2011 02:09
Find:In:Having:Of:
package intelligentpathways.utils
{
/**
* Search a collection, returning the object where object[fieldName] == value. Because I'm sick of writing this ugly loop for every combobox in a system :(
*/
public function findInHavingOf(collection:*, fieldName:String, value:*):*
{
for each (var testee:* in collection)
if (testee && fieldName in testee && testee[fieldName] == value)
return testee;
public function Tag()
{
super();
invalidator = InvalidationManager.forComponent(this);
invalidator.forProperty("node").commitFunctionIs(commitNode);
}
[Bindable]
public var node:XML;
public function getBreakdown(measuringLocationId:Number, fromDate:Date, toDate:Date):AsyncToken
{
return helper.newResponseDecoder()
.createInstanceOf(DisplaySet)
.on(helper.newSoapInvocation()
.onService(service)
.methodNamed("getFugitiveBreakdown")
.addParameter("measuringLocationId", measuringLocationId)
.addParameter("dateRange", { fromDate:fromDate, toDate:toDate })
.addUserCredentials("carbon","carbon")