Thursday, September 20, 2012

Responsive Web: PPI, DPI & DP Explained Simply

As a beginner in the Responsive Web Design space, I’ve recently started to look into how to deal with high density displays. This led me into the very confusing world of PPI’s, DPI’s, DP’s and many people referencing these values in incorrect ways. This is my attempt to explain it all in a non-confusing way.

Wednesday, September 14, 2011

Jenkins and Maven SCP Error: reject HostKey

We lost one of our internal build machines recently (that was a sad day), and so we've been rebuilding our Jenkins environment from the ground up. We use scp access for our distributionManagement control in Maven. Because of this, Jenkins broke on our first build with a whole lot of output saying "The host was not known and was not accepted by the configuration", which narrowed down to this exception:

Caused by: com.jcraft.jsch.JSchException: reject HostKey

Tuesday, August 30, 2011

Testing Concrete Methods in Abstract Classes... With Mockito

There will probably come a time, especially if your life is TDD, that you will need to unit test an abstract class. More specifically, a concrete method in an abstract class. The standard response is, you should create a test implementation (a mock implementation) of that abstract class and then run your tests against that. However, if you're like me, then this smells wrong.

Friday, May 06, 2011

Grails Infinitely Prompts During Jenkins Build

I've mentioned before how I'm using CloudBees RUN@cloud as my hosting solution for Scripty Note... well right alongside that I'm using their DEV@cloud Jenkins CI environment. I have a decent amount of experience with Continuous Integration environments (Hudson, Jenkins... even Cruise Control way back when). I even use and maintain a Jenkins build machine every day at MagnetStreet. So I definitely know my way around Jenkins.

That said, I was recently at a loss when I added the MySQL Connector/J grails plugin to the Scripty Note project. Everything worked great on my own machine, but when Jenkins picked it up, I was in for some excitement. The build started at about 10pm that night (which I was not monitoring) and when I checked build status the next morning, lo and behold, all of my DEV@cloud build minutes had been used up and I had received an email from someone at CloudBees saying they had stopped my build when they noticed my EBS volume had filled up because of my build log. The build had been running in an infinite loop, prompting in the log:

"Overwrite existing DataSource.groovy? (y, Y, n, N)"

Tuesday, May 03, 2011

GitIgnore for Eclipse Grails Projects

Since I'm a git newb, I had to recently set up git on my machine and try to figure out the best way to set up the ignore properties. Coming from an SVN background (and ClearCase, but I don't like to talk about that), I started to wonder what I needed to exclude from the commit in an ignore file. By doing searches in multiple areas, including the wonderful collections of gitignores at github, I've come up with what I like to call "The Perfect .gitignore". This means I only have two .gitignore files. One in the root of my project, and the other in my home directory. That's right Git allows a global ignore file! If you know your envirnoment (i.e. - Eclipse in Windows), then you can make sure none of your projects will commit naughty environment code.

Monday, May 02, 2011

Grails Subdomain Redirects

Since I'm using Cloudbees Run@Cloud service to host Scripty Note, I don't have access to their nginx configuration files (somewhat annoying). Since the nature of ScriptyNote is to be small, then we need to automatically remove the 'www' subdomain on any incoming requests and 301 redirect back to the no-www url. I posted a question here on stackoverflow and a very nice gentleman let me in on the Grails Filters convention. So here's the code I ended up implementing to redirect from 'www.scriptynote.com' to 'scriptynote.com'.