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 java.awt.datatransfer.StringSelection | |
import java.awt.Toolkit | |
import java.awt.datatransfer.* | |
class ClipboardUtils{ | |
static final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard() | |
static void setClipboardContents(final String contents){ | |
clipboard.setContents(new StringSelection(contents), null) | |
} |
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
# 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 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 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.myapp.dao; | |
import java.io.Writer; | |
import java.sql.Connection; | |
import java.sql.SQLException; | |
import oracle.jdbc.OracleConnection; | |
import oracle.sql.CLOB; | |
import org.jboss.resource.adapter.jdbc.WrappedConnection; |
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
def a = [[id:"a"], [id:"b"], [id:"c"]] | |
def b = ["a", "b"] | |
a.retainAll(){ | |
println it | |
b.contains(it.id) | |
} | |
println a |
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
<executions> | |
<execution> | |
<phase>package</phase> | |
<goals> | |
<goal>shade</goal> | |
</goals> | |
<configuration> | |
<artifactSet> | |
<excludes> | |
<exclude>org.bouncycastle:*</exclude> |
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
from __future__ import (absolute_import, division) | |
__metaclass__ = type | |
from ansible.errors import AnsibleError | |
from ansible.plugins.lookup import LookupBase | |
from ansible.utils.listify import listify_lookup_plugin_terms | |
import xml.etree.ElementTree as etree | |
# Version for Ansible 2.0 | |
# forked from https://gist.github.com/benbramley/xmlfile.py |
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.example.app.config.logging; | |
import javax.servlet.ServletContextEvent; | |
import javax.servlet.ServletContextListener; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
/** |
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.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; | |
/** |
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 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; |
NewerOlder