To bring technology to my garden using cheap electronics like the Arduino and Rasberry Pi in a connected independent way.
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
import grails.test.ControllerUnitTestCase | |
import org.apache.commons.lang.StringUtils | |
/** | |
* Provide support for unit testing Grails web flows inside of controllers. | |
* Extending ControllerUnitTestCase which will provide us with much | |
* of the needed mocking around properties and methods that Grails | |
* provides. Just as ControllerUnitTestCase does it will determine the | |
* controller based on the test name as well as the web flow to test. | |
* |
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
class MealController { | |
def mealService | |
final breakfastFlow = { | |
init { | |
action { | |
conversation.meal = mealService.prepareForBreakfast() | |
} | |
on('success').to('chooseMainDish') |
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 country = "Australia" | |
println TimeZone.getAvailableIDs().findAll { it.matches /^(${country}).*/ }.join('\n') |
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
import groovy.json.JsonBuilder | |
import groovy.json.JsonSlurper | |
def knownNonBooks = [ // Not listed on any wiki's | |
"adonato's book", | |
"alchemist's note", | |
"bandit's journal", | |
"decree of monument", | |
"imperial missive (battle-born)", | |
"love poem", |
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
notifications = [ | |
'Final status', | |
'Status update', | |
'Status error', | |
'Plugin installed', | |
'Created file', | |
'Created artefact', | |
'Compile start', | |
'Compile done', | |
'Clean done', |
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
@Grab('org.subethamail:subethasmtp-wiser:1.2') import org.subethamail.wiser.Wiser | |
Wiser wiser = new Wiser() | |
wiser.start() | |
addShutdownHook { | |
if (wiser.server.isRunning()) { | |
println "\nStopping..." | |
wiser.stop() | |
} |
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
#!/bin/bash | |
# | |
# This file echoes a bunch of color codes to the | |
# terminal to demonstrate what's available. Each | |
# line is the color code of one forground color, | |
# out of 17 (default + 16 escapes), followed by a | |
# test use of that color on all nine background | |
# colors (default + 8 escapes). | |
# |
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
// Repository for Java Netflix Client. | |
@GrabResolver(name='BLC', root='http://nexus.blueleftistconstructor.com/content/repositories/releases') | |
// Java Netflix Client to abstract the raw http calls for us. | |
@Grab(group='com.lysergicjava.nfclient', module='netflix-java-client', version='2.1.2') | |
// The netflix-java-client uses SLF4J and complains if we don't have a facade around. | |
@Grab(group='org.slf4j', module='slf4j-simple', version='1.7.2') | |
// HttpClient since we want the stream for downloading the index file, and |
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/local/bin/groovy | |
@Grab('commons-io:commons-io:2.4') | |
@Grab('com.drewnoakes:metadata-extractor:2.6.2') | |
@GrabExclude('xerces:xercesImpl') | |
import java.text.SimpleDateFormat | |
import org.apache.commons.io.monitor.* | |
import com.drew.imaging.ImageMetadataReader | |
import com.drew.metadata.exif.* |
OlderNewer