This file contains 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
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") |
This file contains 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
public function Tag() | |
{ | |
super(); | |
invalidator = InvalidationManager.forComponent(this); | |
invalidator.forProperty("node").commitFunctionIs(commitNode); | |
} | |
[Bindable] | |
public var node:XML; |
This file contains 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
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; |
This file contains 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
#!/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] |
This file contains 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
#general tracking sites, ad servers, and general evil pulled from chrome tracking graph plugin | |
127.0.0.1 buysellads.com | |
127.0.0.1 newrelic.com | |
127.0.0.1 polldaddy.com | |
127.0.0.1 quantserve.com | |
127.0.0.1 googlesyndication.com | |
127.0.0.1 google-analytics.com | |
127.0.0.1 chartbeat.com | |
127.0.0.1 netshelter.net | |
127.0.0.1 skimresources.com |
This file contains 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
String inputLine = "append \"bow wow wow yippee-o yippee-ay\" dir1/dir2/file.txt"; | |
Pattern regex = Pattern.compile("^(\\w+)\\s+\"(.*?)\"\\s+([\\w.\\/]+)$"); | |
Matcher m = regex.matcher(inputLine); | |
String cmd = m.group(1); // append | |
String data = m.group(2); // snooplish | |
String path = m.group(3); // What's left |
This file contains 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
// Calc whole pixel widths using Bresenham's line algorithm (useful thing, innit?) | |
function distributeWidthAsColumns(width, numColumns) { | |
var columnWidths = []; | |
var columnWidthIdeal = width / numColumns; | |
var totalWholePixels = 0; | |
var errorTotal = 0; | |
var pixelWidth = Math.floor(columnWidthIdeal); | |
var errorPerColumn = columnWidthIdeal - pixelWidth; |
This file contains 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
package com.expantra; | |
import com.expantra.buzhash.BuzHash; | |
import javax.xml.bind.DatatypeConverter; | |
import java.io.*; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import static java.lang.System.out; |
This file contains 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
package com.expantra.buzhash; | |
/** | |
* Created by josh on 16/04/2014. | |
* Not thread-safe, not nothin not nohow :) | |
*/ | |
public class BuzHash { | |
// via sublime text column mode, and cat /dev/random | hexdump | |
static private final int[] randomInts = { |
This file contains 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
package main | |
// Originally ripped from here: http://www.ostree.org/code-snippet/91/csv-comma-separated-values-example-in-golang and modified. | |
import ( | |
"encoding/csv" | |
"fmt" | |
"os" | |
"unicode/utf8" | |
"strings" |
OlderNewer