<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-18139903</id><updated>2024-10-06T23:26:08.067-05:00</updated><category term="grails"/><category term="cloudbees"/><category term="jenkins"/><category term="scriptynote"/><category term="301"/><category term="density"/><category term="eclipse"/><category term="error"/><category term="gant"/><category term="git"/><category term="gitignore"/><category term="java"/><category term="maven"/><category term="mockito"/><category term="mvn"/><category term="mysql"/><category term="no-www"/><category term="redirect"/><category term="rwd"/><category term="scp"/><category term="tdd"/><category term="test"/><title type='text'>Obviously Blatant</title><subtitle type='html'>I have a lot of different coding projects and sometimes I come across little gems of information that I feel must be shared. Hopefully you&#39;ll find something helpful here... and if you do, let me know!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.obviouslyblatant.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18139903/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://www.obviouslyblatant.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12174125131070375525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-18139903.post-8964542647544999276</id><published>2012-09-20T11:23:00.000-05:00</published><updated>2013-01-28T10:29:36.217-06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="density"/><category scheme="http://www.blogger.com/atom/ns#" term="rwd"/><title type='text'>Responsive Web: PPI, DPI &amp; DP Explained Simply</title><content type='html'>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.
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;
&lt;h3&gt;
First, Some Calculations:&lt;/h3&gt;
Enter Galaxy Nexus
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Resolution: 1280 x 720 px&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Screen Size: 4.65” diagonal&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
We can calculate the &lt;b&gt;PPI&lt;/b&gt; (Pixels Per Inch) by dividing the total pixels on the screen (1280*720) by the physical area of the screen. It’s important to note that PPI is a &lt;b&gt;physical calculation&lt;/b&gt; of the screen, that never changes.
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Galaxy Nexus &lt;b&gt;PPI: 316&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;i&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;For the sake of superb simplicity, I’m leaving out the extra details about how PenTile can affect this calculation.&lt;/span&gt;&lt;/i&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, enter &lt;b&gt;DPI&lt;/b&gt; (Dots Per Inch). While PPI was a physical calculation, DPI is &lt;b&gt;adjustable&lt;/b&gt;, depending on how dense the manufacturer wants the screen to be. Often, they will choose a default DPI value closest to the PPI.
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Galaxy Nexus &lt;b&gt;Default DPI: 320&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;i&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;This value can be adjusted by the user with an app or custom ROM.&lt;/span&gt;&lt;/i&gt;
&lt;br /&gt;
&lt;br /&gt;
DPI is important because it helps us calculate the &lt;b&gt;DP/DiP&lt;/b&gt; (Density-independent Pixel). These are ‘virtual pixels’, which as far as we’re concerned in Responsive Web Design, is the device’s resolution. We can calculate the dp by dividing the number of pixels by (DPI / 160). Why 160? It’s the baseline.
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;So, a Galaxy Nexus with DPI set to 320 gives us a new resolution: &lt;b&gt;640 x 360 dp&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;If a user lowered their DPI to 240, their resolution would be 853.33 x 480 dp.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h3&gt;
How this all relates to RWD&lt;/h3&gt;
In a ‘mobile’ browser viewport, the width and height are usually much larger than the normal dimensions on the screen. This is a virtual resolution specifically given to the page so that you can see a ‘zoomed-out’ view of that site.
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;A mobile device will use this viewport’s resolution width and height for media queries and css calculations.&lt;/li&gt;
&lt;li&gt;The dp resolution values are reported on Android/iOS devices as Device Width and Device Height.&lt;/li&gt;
&lt;li&gt;Adding &lt;span style=&quot;background-color: #eeeeee; font-family: Courier New, Courier, monospace;&quot;&gt;meta name=&quot;viewport&quot; width=&quot;device-width&quot;&lt;/span&gt; to the page will force the viewport to render using the dp resolution. Alternatively, if you just want to match on media queries, calculating based on device-width/device-height in the media query instead of just width/height will have better matched results.&lt;/li&gt;
&lt;li&gt;Guess what, Windows Phone went different... for every phone with WP7, device-width is always 320 in portrait and 480 in landscape, no matter what.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h3&gt;
Sidenote: Density&lt;/h3&gt;
Density, in this context, refers to the relationship between the screens px count versus the dp count. A higher density means you have more pixels available to render your dp which translates to the screen appearing ‘sharper’. This is usually represented as a ratio, the &lt;b&gt;Device Pixel Ratio&lt;/b&gt;. It’s calculated as the phone’s width or height in &lt;b&gt;px divided by&lt;/b&gt; the related width or height in &lt;b&gt;dp&lt;/b&gt;.
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;At default DPI, Galaxy Nexus’ &lt;b&gt;Device Pixel Ratio: 2&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;If a user lowered their DPI to 240, their Device Pixel Ratio would be 1.5. This means they would have more resolution available, but less density.&lt;/li&gt;
&lt;li&gt;Surprise, Windows Phone does it different again! Device Pixel Ratio is unavailable on WP7. Instead, you can grab the DPI and the screen width yourself, calculate the dp, and then calculate the ratio. Nice.&lt;/li&gt;
&lt;/ul&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.obviouslyblatant.com/feeds/8964542647544999276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/18139903/8964542647544999276' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18139903/posts/default/8964542647544999276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18139903/posts/default/8964542647544999276'/><link rel='alternate' type='text/html' href='http://www.obviouslyblatant.com/2012/09/responsive-web-ppi-dpi-dp-explained.html' title='Responsive Web: PPI, DPI &amp; DP Explained Simply'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12174125131070375525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18139903.post-7816112383118548530</id><published>2011-09-14T11:12:00.000-05:00</published><updated>2013-02-07T07:58:34.200-06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="error"/><category scheme="http://www.blogger.com/atom/ns#" term="jenkins"/><category scheme="http://www.blogger.com/atom/ns#" term="maven"/><category scheme="http://www.blogger.com/atom/ns#" term="mvn"/><category scheme="http://www.blogger.com/atom/ns#" term="scp"/><title type='text'>Jenkins and Maven SCP Error: reject HostKey</title><content type='html'>We lost one of our internal build machines recently (that was a sad day), and so we&#39;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 &quot;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;The host was not known and was not accepted by the configuration&lt;/span&gt;&quot;, which narrowed down to this exception:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
Caused by: com.jcraft.jsch.JSchException: reject HostKey&lt;/div&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;
Our server configurations were properly set in Jenkins&#39; settings.xml, so we thought this would be an easy fix by just ssh-ing to that host which should register it into the hostnames. Not So FAST. We tried this as many different users including ROOT and jenkins. Ran the build again, same error. We tried a lot of things next, most of which I don&#39;t care to relive. Nothing worked. Here&#39;s what actually worked, on our Ubuntu environment (modify according to your own environment).
&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/outdooricon/1216970.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
This will prompt you to accept the host authenticity, which of course you should accept.&lt;br /&gt;
&lt;br /&gt;
I do not entirely understand why this actually prompts. Since this command shows up as a process running as Jenkins user, which I had already approved the host for. My suspicion is that maven actually runs that command as it&#39;s own user.  However I don&#39;t really know how to verify that suspicion, and now that it works, it&#39;s time to move on. </content><link rel='replies' type='application/atom+xml' href='http://www.obviouslyblatant.com/feeds/7816112383118548530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/18139903/7816112383118548530' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18139903/posts/default/7816112383118548530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18139903/posts/default/7816112383118548530'/><link rel='alternate' type='text/html' href='http://www.obviouslyblatant.com/2011/09/jenkins-and-maven-scp-error-reject.html' title='Jenkins and Maven SCP Error: reject HostKey'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12174125131070375525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18139903.post-3868534449229544843</id><published>2011-08-30T12:04:00.000-05:00</published><updated>2013-02-07T07:59:23.354-06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="mockito"/><category scheme="http://www.blogger.com/atom/ns#" term="tdd"/><category scheme="http://www.blogger.com/atom/ns#" term="test"/><title type='text'>Testing Concrete Methods in Abstract Classes... With Mockito</title><content type='html'>There will probably come a time, especially if your life is &lt;a href=&quot;http://en.wikipedia.org/wiki/Test-driven_development&quot;&gt;TDD&lt;/a&gt;, 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&#39;re like me, then this smells wrong.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;If the structure of the abstract class changes in the future, then you&#39;d need to update this test implementation. This is unnecessary maintenance. 5 years ago, there was argument for building out an extensive object-mocking library in your code, but there is just no reason anymore.&lt;/li&gt;
&lt;li&gt;The object creation code itself takes away from the simple readability a test should have. Each test should read like a note about the code it&#39;s testing: &quot;You know I&#39;ve been thinking, given that a car is blue, when that car is being driven, then the car description should also say that it is blue&quot;. Not &quot;You know, given that a car is blue, when that car &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;new blueCarImp class extends Car getColor return super getColor&lt;/span&gt; 01000110 OMG WHAT JUST HAPPENED TO MY CAR&quot; &lt;span style=&quot;font-size: xx-small;&quot;&gt;(I realize that you can have a mock object existing somewhere else and instantiate that object, however that has the smell of not keeping all test related code inside of or close to that test. Also see #1)&lt;span style=&quot;font-size: small;&quot;&gt;. &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
This is where Testing Frameworks come to the rescue.&lt;br /&gt;
&lt;br /&gt;
At MagnetStreet, we use Mockito. I&#39;ve use a few different testing frameworks, and this is by far my favorite for being the most readable. The only problem is, when you mock an abstract class in mockito, it will stub out the method you want to test. So, if you do some searching around, you&#39;ll see people recommend using the spy ability. It can be even easier. Without any more drama, here&#39;s the solution:
&lt;script src=&quot;https://gist.github.com/outdooricon/1181365.js&quot;&gt; &lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.obviouslyblatant.com/feeds/3868534449229544843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/18139903/3868534449229544843' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18139903/posts/default/3868534449229544843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18139903/posts/default/3868534449229544843'/><link rel='alternate' type='text/html' href='http://www.obviouslyblatant.com/2011/08/testing-concrete-methods-in-abstract.html' title='Testing Concrete Methods in Abstract Classes... With Mockito'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12174125131070375525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18139903.post-4697306318226314282</id><published>2011-05-06T07:49:00.000-05:00</published><updated>2012-03-28T08:09:44.594-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cloudbees"/><category scheme="http://www.blogger.com/atom/ns#" term="gant"/><category scheme="http://www.blogger.com/atom/ns#" term="grails"/><category scheme="http://www.blogger.com/atom/ns#" term="jenkins"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="scriptynote"/><title type='text'>Grails Infinitely Prompts During Jenkins Build</title><content type='html'>I&#39;ve mentioned before how I&#39;m using CloudBees RUN@cloud as my hosting solution for &lt;a href=&quot;http://scriptynote.com/&quot;&gt;Scripty Note&lt;/a&gt;... well right alongside that I&#39;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.&lt;br /&gt;
&lt;br /&gt;
That said, I was recently at a loss when I added the &lt;a href=&quot;http://www.grails.org/plugin/mysql-connectorj&quot;&gt;MySQL Connector/J&lt;/a&gt; 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: &lt;br /&gt;
&lt;br /&gt;
&quot;&lt;code&gt;Overwrite existing DataSource.groovy? (y, Y, n, N)&lt;/code&gt;&quot;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Now, I had actually appreciated that prompt when I first added that plugin to the project. It had helped me upgrade the DataSource.groovy to use MySQL without hardly needing to think about it. But prompting in the build is a different story. Now as some of you probably know, the Grails plugin for Jenkins passes the &lt;code&gt;--non-interactive&lt;/code&gt; flag through to grails on the upgrade step. However, this plugin doesn&#39;t actually get installed on the upgrade step (even if it did, the plugin ignores that flag). It actually gets installed during the &lt;code&gt;test-app&lt;/code&gt; or &lt;code&gt;run-app&lt;/code&gt; stage. Also, Jenkins automatically passes &lt;code&gt;null&lt;/code&gt; through to any user prompts during the build, which that plugin interprets essentially as a &lt;code&gt;/r&lt;/code&gt; (causing the re-prompt). So the situation was looking pretty dire.&lt;br /&gt;
&lt;br /&gt;
But then I took a look at the post-install gant script for that MySQL Connector/J plugin. Turns out that it checks for a very specific property before prompting for input: &quot;&lt;code&gt;overwrite.datasource&lt;/code&gt;&quot;.&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: right; margin-left: 1em; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6WKNVXr_m2ag0nAbSZ_MB4LfZCyA4LnbaKOvqU8uCnj1iAZdRmwy3ZE5X-q6nF2AM6clmc_EmPVfcXNiVCavrM31rTNKl8SqHfJGivHgOl7eljBG-OvgKZvapfGQ2S6xbmcOH/s1600/JenkinsDataSourceOverwrite.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6WKNVXr_m2ag0nAbSZ_MB4LfZCyA4LnbaKOvqU8uCnj1iAZdRmwy3ZE5X-q6nF2AM6clmc_EmPVfcXNiVCavrM31rTNKl8SqHfJGivHgOl7eljBG-OvgKZvapfGQ2S6xbmcOH/s320/JenkinsDataSourceOverwrite.png&quot; width=&quot;275&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Jenkins Grails Configuration Example&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
And that&#39;s the key to the problem. So, in order to get your build to bypass that prompt, simply pass&lt;br /&gt;
&lt;br /&gt;
&quot;&lt;code&gt;overwrite.datasource=false&lt;/code&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
through in the Grails build properties. That should take care of any prompts and let your Jenkins build hum along quite happily. It seems odd that this parameter is so completely undocumented. And furthermore, that it is so hard to find other people who have run into this problem. Maybe it&#39;s because there&#39;s a very obvious solution to this that we completely missed :). In any case, I&#39;m just glad that the plugin&#39;s source code was available for us to dig into.&lt;br /&gt;
&lt;br /&gt;
One side note: after explaining the situation to CloudBees, they quickly reimbursed my minutes back to me without any hassle. That coupled with how they had monitored my build for oddities, shows how much promise this company has as a PaaS. They&#39;ve been really great to work with so far.</content><link rel='replies' type='application/atom+xml' href='http://www.obviouslyblatant.com/feeds/4697306318226314282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/18139903/4697306318226314282' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18139903/posts/default/4697306318226314282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18139903/posts/default/4697306318226314282'/><link rel='alternate' type='text/html' href='http://www.obviouslyblatant.com/2011/05/grails-infinitely-prompts-during.html' title='Grails Infinitely Prompts During Jenkins Build'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12174125131070375525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6WKNVXr_m2ag0nAbSZ_MB4LfZCyA4LnbaKOvqU8uCnj1iAZdRmwy3ZE5X-q6nF2AM6clmc_EmPVfcXNiVCavrM31rTNKl8SqHfJGivHgOl7eljBG-OvgKZvapfGQ2S6xbmcOH/s72-c/JenkinsDataSourceOverwrite.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18139903.post-7797056166918343838</id><published>2011-05-03T08:13:00.003-05:00</published><updated>2013-02-07T08:00:16.191-06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="gitignore"/><category scheme="http://www.blogger.com/atom/ns#" term="grails"/><title type='text'>GitIgnore for Eclipse Grails Projects</title><content type='html'>Since I&#39;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&#39;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 &lt;a href=&quot;https://github.com/github/gitignore&quot;&gt;gitignores at github&lt;/a&gt;, I&#39;ve come up with what I like to call &quot;The Perfect .gitignore&quot;. This means I only have two .gitignore files. One in the root of my project, and the other in my home directory. That&#39;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.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
So here is my grails project .gitignore (just place this in project root):&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/outdooricon/953268.js&quot;&gt;
 
&lt;/script&gt;&lt;br /&gt;
And here is my Windows-Eclipse specific .gitignore_global (I put this in my home dir):&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/outdooricon/953288.js&quot;&gt;
 
&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
To use this global file, run something like: &lt;code&gt;git config --global core.excludesfile ~/.gitignore_global&lt;/code&gt; where &lt;code&gt;~/.gitignore_global&lt;/code&gt; should change to be wherever you want to host your config.</content><link rel='replies' type='application/atom+xml' href='http://www.obviouslyblatant.com/feeds/7797056166918343838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/18139903/7797056166918343838' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18139903/posts/default/7797056166918343838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18139903/posts/default/7797056166918343838'/><link rel='alternate' type='text/html' href='http://www.obviouslyblatant.com/2011/05/gitignore-for-eclipse-grails-projects.html' title='GitIgnore for Eclipse Grails Projects'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12174125131070375525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18139903.post-4037455419908333721</id><published>2011-05-02T21:45:00.006-05:00</published><updated>2013-02-07T08:00:27.528-06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="301"/><category scheme="http://www.blogger.com/atom/ns#" term="cloudbees"/><category scheme="http://www.blogger.com/atom/ns#" term="grails"/><category scheme="http://www.blogger.com/atom/ns#" term="no-www"/><category scheme="http://www.blogger.com/atom/ns#" term="redirect"/><category scheme="http://www.blogger.com/atom/ns#" term="scriptynote"/><title type='text'>Grails Subdomain Redirects</title><content type='html'>Since I&#39;m using Cloudbees Run@Cloud service to host &lt;a href=&quot;http://scriptynote.com/&quot;&gt;Scripty Note&lt;/a&gt;, I don&#39;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 &#39;www&#39; subdomain on any incoming requests and 301 redirect back to the no-www url. I posted a question &lt;a href=&quot;http://stackoverflow.com/questions/5795445/what-is-the-best-way-to-redirect-a-www-subdomain-within-a-grails-webapp&quot;&gt;here&lt;/a&gt; on stackoverflow and a very nice gentleman let me in on the Grails Filters convention. So here&#39;s the code I ended up implementing to redirect from &#39;www.scriptynote.com&#39; to &#39;scriptynote.com&#39;.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/outdooricon/953585.js&quot;&gt;
&lt;/script&gt;&lt;br /&gt;
There it is. By convention, as long as this class ends with &lt;code&gt;Filters&lt;/code&gt; and is sitting in &lt;code&gt;grails-app/conf&lt;/code&gt;, it will be picked up. Also, it would be easy enough to do some switching around in the code and you can produce the opposite effect as needed.</content><link rel='replies' type='application/atom+xml' href='http://www.obviouslyblatant.com/feeds/4037455419908333721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/18139903/4037455419908333721' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18139903/posts/default/4037455419908333721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18139903/posts/default/4037455419908333721'/><link rel='alternate' type='text/html' href='http://www.obviouslyblatant.com/2011/05/grails-subdomain-redirects.html' title='Grails Subdomain Redirects'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12174125131070375525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>