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
class Person { | |
String firstName | |
String lastName | |
transient getFullName() { "${firstName} ${lastName}" } | |
} |
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
if (condition) | |
statement | |
else { | |
statement | |
statement | |
} |
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
def dir = new File(args.length > 0 ? args[0] : "/Users/josh/Desktop/image") | |
def fps = args.length > 1 ? args[1] as int : 10 | |
def parser = new java.text.SimpleDateFormat(args.length > 2 ? args[2] : "yyyy_MM_dd_-_hh_mm_ss.SSS") | |
def formatter = new java.text.SimpleDateFormat("hh:mm:ss") | |
// find all image files and sort them by the date encoded in the filename | |
def files = [:] as TreeMap | |
dir.eachFileMatch(~/.*\.jpg/) { file -> | |
def date = parser.parse(file.name - "_UTF.jpg") | |
files[date.time] = file |
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
List.metaClass.safeFirst = { -> delegate[0] } | |
List.metaClass.safeLast = { -> delegate.size() > 0 ? delegate[-1] : null } | |
def a = [] | |
assert null == a.safeFirst() | |
assert null == a.safeLast() | |
a += [1,2] | |
assert 1 == a.safeFirst() | |
assert 2 == a.safeLast() |
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
2011-07-26 16:47:50,809 [TP-Processor25] DEBUG facebook.FacebookController - params: [id:660, action:challenge, controller:facebook] | |
2011-07-26 16:47:50,812 [TP-Processor25] ERROR util.FacebookHelperService - Couldn't tokenize signedRequest: null | |
2011-07-26 16:47:50,813 [TP-Processor25] DEBUG facebook.FacebookController - signed request: [:] | |
2011-07-26 16:47:50,814 [TP-Processor25] DEBUG facebook.FacebookController - person: null person.id: null uid: null pid: null isPageAdmin: null |
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
def sb = new StringBuffer("Foo") | |
def foo = "Foo" | |
assert sb == foo | |
/** | |
assert sb == foo | |
| | | | |
Foo| Foo | |
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
#!/bin/sh | |
# A commit hook script that automatically tags commits for Lean-To integration if you use a branching scheme | |
# bug/<num> or story/<num> | |
# | |
# Drop this file into your repos .git/hooks/ directory as 'commit-msg' | |
LEANTO="1179" | |
# figure out bug/story and id |
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
14:01:59.232 DEBUG <> [ ] {} (localhost-startStop-1) conf.BootStrap - Registering JSON object marshaller on: Artefact > Location | |
14:01:59.232 DEBUG <> [ ] {} (localhost-startStop-1) conf.BootStrap - Registering JSON object marshaller on: Artefact > Mode | |
14:01:59.365 ERROR <> [ ] {} (localhost-startStop-1) context.GrailsContextLoader - Error executing bootstraps: java.lang.ExceptionInInitializerError | |
org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.ExceptionInInitializerError | |
at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:301) | |
at grails.util.Environment.executeForEnvironment(Environment.java:294) | |
at grails.util.Environment.executeForCurrentEnvironment(Environment.java:270) | |
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) | |
at java.util.concurrent.FutureTask.run(FutureTask.java:166) | |
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) |
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
/** | |
* Scheduled On and Off | |
* | |
* Author: SmartThings | |
*/ | |
def preferences() | |
{ | |
return [ | |
sections: [ |
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
// simulates random messages from a contact sensor via socket to dev-conn | |
RANDOM = new Random() | |
MESSAGES = [ | |
"zone report :: type: 19 value: 0031", | |
"zone report :: type: 19 value: 0030" | |
] | |
ENV = [ | |
josh: [ |
OlderNewer