Skip to content

Instantly share code, notes, and snippets.

@jaxzin
jaxzin / gist:929276
Created April 19, 2011 18:59
Ban logging dependencies that collide with slf4j or your chosen logging implementation.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0-alpha-3</version>
<executions>
<execution>
<id>ban-other-loggers</id>
<goals>
<goal>enforce</goal>
</goals>
@jaxzin
jaxzin / gist:929283
Created April 19, 2011 19:02
SLF4J dependencies for routing all log messages through one logging implementation.
<!-- Use JDK logging for runtime since that's what Glassfish uses. -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.5.6</version>
<scope>runtime</scope>
</dependency>
<!-- Anything using log4j should defer to slf4j. -->
<dependency>
@jaxzin
jaxzin / gist:1136294
Created August 10, 2011 07:16
Trying to import old emails into Tumblr
-- Used the Tumblr v1 API because it is light-years simpler http://www.tumblr.com/docs/en/api/v1#api_write
--
-- To use this, open it in the AppleScript Editor, change the properties below,
-- switch to Mail and select the emails with pics attached that you wish to import to tumblr,
-- switch back to the AppleScript Editor and press Run.
--
-- NOTE: tumblr limits your photo uploads to 75 per day, so plan accordingly.
--
property tumblr_email : "----"
<dependencyManagement>
<dependencies>
<!-- Manage secondary loggers by claiming they will be provided -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<scope>provided</scope>
</dependency>
<dependency>
@jaxzin
jaxzin / gist:1219531
Created September 15, 2011 15:18
All secondary frameworks will be provided by SLF4J
<dependencyManagement>
<dependencies>
<!-- Manage secondary loggers by claiming they will be provided -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<scope>provided</scope>
</dependency>
<dependency>
@jaxzin
jaxzin / gist:1725568
Created February 2, 2012 20:27
Banning duplicate classes
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0.1</version>
<inherited>true</inherited>
<executions>
<execution>
<id>enforce-no-duplicate-classes</id>
<goals>
<goal>enforce</goal>
</goals>
@jaxzin
jaxzin / gist:2045327
Created March 15, 2012 17:07 — forked from nicholashagen/gist:2041175
Working with GitHub Forks

The following code is day-to-day operations when working with 3 forks: an open source project, a local fork of that project, and a company fork of that project. The power of Git is remote aliases that allow you to work with all 3 forks in parallel in the same code base and instantly compare, push, merge, etc.

Setup:

#> git clone [url of local fork: ie: username/project]
#> cd project
#> git remote add project [url of project: ie: project/project]
#> git remote add company [url of company fork: ie: company/project]
@jaxzin
jaxzin / gist:2047489
Created March 15, 2012 22:59
Git aliases
# `git tracked` -- Show which remote branches are tracked and the associated local branch
git config --global alias.tracked "for-each-ref --format='%(refname:short) <- %(upstream:short)' refs/heads"
@jaxzin
jaxzin / install-rvm-on-mountain-lion.sh
Created November 19, 2012 14:43
Installing RVM on OS X Mountain Lion
# When Mac OS X Mountain Lion was released, I did a completely clean install. Unfortunately [RVM](http://rvm.io) won't install directly on the stock release. Here are the steps to get the installation working.
# This gist is based in part by [this post](http://theengguy.blogspot.ca/2012/04/setting-up-os-x-lion-and-mountain-lion.html) by [@theengguy](http://twitter.com/theengguy).
# 1. Install [MacPorts](http://www.macports.org)
# You can snag the package installer (easiest) from [https://distfiles.macports.org/MacPorts/MacPorts-2.1.2-10.8-MountainLion.pkg](https://distfiles.macports.org/MacPorts/MacPorts-2.1.2-10.8-MountainLion.pkg)
# 2. Install a new version of curl
sudo port -v selfupdate
sudo port install curl
@jaxzin
jaxzin / gist:8393988
Created January 13, 2014 02:51
Cucumber-JVM, hacking Scenario object to get the scenario name.
@Before
public void initSelenium(Scenario scenario) throws Exception {
// TODO: Find the scenario name
String scenarioName = ((ExecutionUnitRunner)getPrivateField(getPrivateField(scenario, "reporter"), "executionUnitRunner")).getName();
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("version", "5");
capabilities.setCapability("platform", Platform.XP);
capabilities.setCapability("name", scenarioName);