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
# Logic for forking connections | |
# The forked process does not have access to static vars as far as I can discern, so I've done some stuff to check if the op threw an exception. | |
def fork_with_new_connection | |
# Store the ActiveRecord connection information | |
config = ActiveRecord::Base.remove_connection | |
pid = fork do | |
# tracking if the op failed for the Process exit | |
success = true |
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
// | |
// data | |
// | |
def values = """821;1529;56 | |
733;1530;56 | |
749;1533;56 | |
728;1534;56""" | |
// | |
// code |
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
Date enddate = new Date() | |
Date startdate = enddate - 20 | |
//headers | |
println "Date - Year - Quarter - Month - Month - Month - WeekOfYear - WeekOfMonth - DayInYear - DayInMonth - DayInWeek - DayInWeek - DayInWeek - Weekday/Weekend" | |
//loop through each day | |
(startdate..enddate).each{ day -> | |
//Is this a weekend or a weekday? | |
def weekendStatus = 'Weekday' |
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
File file = new File("/tmp/time.csv") | |
//headers | |
file.append "key; hh:MMxm; HH:MM; hh; HH; MM; ampm;\n" | |
int key = 0 | |
(0..23).each{ hour -> | |
String ampm = "am" | |
String upperHString = String.format('%02d', hour) |
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
############################################################### | |
# canon-date.sh | |
# Renames photos taken by Canon Digital Cameras into something | |
# more sortable and useful. | |
# | |
# Depends on exiftool | |
# | |
# Download, make executable, and then run ./canon-date.sh in the | |
# directory of the photos you want to rename. The script will | |
# create sub-directories by year and month. |
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
/* | |
* motorolaDate.groovy | |
* Renames photos taken by Droid X Cameras into something | |
* more sortable and useful. | |
* | |
* runs with groovy http://groovy.codehaus.org/ | |
* | |
* Download, edit the dirName variable, and then run: | |
* groovy motorolaDate.groovy | |
* The script will create sub-directories by year and month. |
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
package model; | |
import java.util.List; | |
import java.util.Map; | |
import org.codehaus.jackson.annotate.JsonAutoDetect; | |
import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility; | |
import org.codehaus.jackson.annotate.JsonProperty; | |
import org.springframework.validation.BindingResult; | |
import org.springframework.validation.FieldError; |
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
package com.example.app.config.logging; | |
import javax.servlet.ServletContextEvent; | |
import javax.servlet.ServletContextListener; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
/** |
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
package factory; | |
import java.util.List; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import com.google.common.collect.Lists; | |
import transferobject.TransferObject; |
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
package com.bowerstudios.config; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
import org.apache.commons.configuration.Configuration; | |
import org.springframework.core.env.EnumerablePropertySource; | |
/** |
OlderNewer