Skip to content

Instantly share code, notes, and snippets.

@outdooricon
outdooricon / .gitignore
Created May 3, 2011 12:49
gitignore for eclipse grails project
*.iws
*Db.properties
*Db.script
.settings
eclipse
stacktrace.log
target
/plugins
/web-app/plugins
/web-app/WEB-INF/classes
@outdooricon
outdooricon / .gitignore_global
Created May 3, 2011 13:03
global gitignore for windows eclipse environment
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@outdooricon
outdooricon / DomainFilters.groovy
Created May 3, 2011 15:47
Strip all requests with www subdomain and 301 redirect.
class DomainFilters {
def filters = {
wwwCheck(uri:'/**') {
before = {
if (request.getServerName().startsWith("www.")) {
int port = request.getServerPort();
if (request.getScheme().equals("http") && port == 80) {
port = -1;
} else if (request.getScheme().equals("https") && port == 443) {
@outdooricon
outdooricon / gist:1181365
Created August 30, 2011 17:02
example of testing an abstract class with Mockito
// The Abstract Class We Are Testing
public Abstract class Car {
public String getDescription(String color) {
return "sleek "+color+" car";
};
}
// Test Contained in Separate Class Below
Car blueCar = mock(Car.class);
@outdooricon
outdooricon / gist:1216970
Last active September 27, 2015 05:08
Force maven to prompt for hostname authenticity acceptance
# sudo su jenkins
# cd ~jenkins/jobs/[INSERT_PROJECT_NAME]/workspace
# ~jenkins/tools/hudson.tasks.Maven_MavenInstallation/maven3/bin/mvn clean deploy
@outdooricon
outdooricon / keybase.md
Created February 28, 2014 14:19
Keybase Verification

Keybase proof

I hereby claim:

  • I am outdooricon on github.
  • I am johnathon (https://keybase.io/johnathon) on keybase.
  • I have a public key whose fingerprint is E7B2 BF9F 9902 D6B8 778B 080A 2772 A330 85A1 A972

To claim this, I am signing this object:

@outdooricon
outdooricon / backbonePrototypeExtender.coffee
Last active August 29, 2015 14:13
Easily use composition to build Backbone object prototypes
extendPrototypeFromArray = (protoConstructor) ->
_.wrap protoConstructor.extend, (cachedExtend, mixinArray, prototype) ->
if mixinArray instanceof Array
# Uses _.defaults so base object overrides anything being added
fullProto = _.defaults.apply _, [prototype].concat(mixinArray)
else
fullProto = mixinArray
cachedExtend.call @, fullProto
Backbone.Model.extend = extendPrototypeFromArray Backbone.Model