Skip to content

Instantly share code, notes, and snippets.

View semarco's full-sized avatar

Marco Sehrer semarco

View GitHub Profile
// Gradle script for detached apps.
import org.apache.tools.ant.taskdefs.condition.Os
void runBefore(String dependentTaskName, Task task) {
Task dependentTask = tasks.findByPath(dependentTaskName);
if (dependentTask != null) {
dependentTask.dependsOn task
}
}
@semarco
semarco / utc-times.rb
Created July 11, 2012 13:50 — forked from ayosec/utc-times.rb
Force UTC times
class Hash
def times_with_utc
dup.tap do |new_hash|
each_key do |key|
value = self[key]
if ActiveSupport::TimeWithZone === value
new_hash[key] = value.utc
elsif Array === value || Hash === value
new_hash[key] = value.times_with_utc
end