<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description></description><title>boiling memoir</title><generator>Tumblr (3.0; @shenie)</generator><link>http://blog.shenie.info/</link><item><title>Grails, spring-ws, SOAP &amp; HTTP request's content type</title><description>&lt;div class="posterous_autopost"&gt;&lt;p&gt;If you ever have to use Grails to process a fucked up SOAP request with a content type of application/x-www-form-urlencoded then this post is for you.&lt;/p&gt;  &lt;p&gt;p.s. eventually we will stop processing that kind of requests but for now we need it to work so client has time to fix their shit up&lt;/p&gt;  &lt;p&gt;Problem with application/x-www-form-urlencoded requests &amp; spring-ws’ message factory is that it does not like requests with that content type. Rightly so!&lt;/p&gt;  &lt;p&gt;The message factory content type issue is obvious since the exception that it throws at you is pretty self-explanatory. The work-around is pretty easy, define your own messageFactory spring bean that is more lenient on the content type.&lt;/p&gt;  &lt;p&gt;But after the content type is sorted you would face the second problem “Premature end of file”. It took me a while to figure out what is happening. In retrospect it is actually quite logical. The end of file is referring to the request’s input stream which has been consumed by Grails filters before it gets to the message factory. The following filters are responsible for parsing the request and routing, luckily they are also subclasses of OncePerRequestFilter which means you can easily bypass them to avoid input stream been consumed.&lt;/p&gt;  &lt;ol&gt;&lt;li&gt;grailsWebRequest&lt;/li&gt;  &lt;li&gt;urlMapping&lt;/li&gt;  &lt;li&gt;hiddenHttpMethod&lt;/li&gt;  &lt;/ol&gt;&lt;/div&gt;</description><link>http://blog.shenie.info/post/6374155066</link><guid>http://blog.shenie.info/post/6374155066</guid><pubDate>Fri, 10 Jun 2011 13:39:16 +1000</pubDate></item><item><title>How to use Groovy categories in gsp's</title><description>&lt;div class="posterous_autopost"&gt;&lt;p&gt;You use &lt;a href="http://docs.codehaus.org/display/GROOVY/Groovy+Categories"&gt;Groovy categories&lt;/a&gt; in a canonical way in gsp’s. i.e. by surrounding all your gsp code inside a call to&lt;/p&gt;  &lt;p style="padding-left: 30px;"&gt;&lt;% use(YourCategoryClass) { %&gt;&lt;/p&gt;  &lt;p style="padding-left: 30px;"&gt;&lt;% } %&gt;&lt;/p&gt;  &lt;p&gt;But it gets troublesome quite soon, especially if the main gsp renders other partial templates.&lt;/p&gt;  &lt;p&gt;Luckily there is a way to hook into the view rendering workflow. The trick is to provide your own implementation of View that invoke the call to use categories around the view.render method. To do that you also need to override the default jspViewResolver spring bean with your own implementation of ViewResolver which uses your own implementation of View. Lastly if you need dynamically decide what categories classes to use then you can pass it in the model attribute inside your controller.&lt;/p&gt;  &lt;p&gt;The result will look something like this.&lt;/p&gt;  &lt;div class="data type-groovy"&gt;  &lt;table cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt; &lt;pre class="line_numbers"&gt;&lt;span rel="#L1" id="L1"&gt;1&lt;/span&gt; &lt;span rel="#L2" id="L2"&gt;2&lt;/span&gt; &lt;span rel="#L3" id="L3"&gt;3&lt;/span&gt; &lt;span rel="#L4" id="L4"&gt;4&lt;/span&gt; &lt;span rel="#L5" id="L5"&gt;5&lt;/span&gt; &lt;span rel="#L6" id="L6"&gt;6&lt;/span&gt; &lt;span rel="#L7" id="L7"&gt;7&lt;/span&gt; &lt;span rel="#L8" id="L8"&gt;8&lt;/span&gt; &lt;span rel="#L9" id="L9"&gt;9&lt;/span&gt; &lt;span rel="#L10" id="L10"&gt;10&lt;/span&gt; &lt;span rel="#L11" id="L11"&gt;11&lt;/span&gt; &lt;span rel="#L12" id="L12"&gt;12&lt;/span&gt; &lt;span rel="#L13" id="L13"&gt;13&lt;/span&gt; &lt;span rel="#L14" id="L14"&gt;14&lt;/span&gt; &lt;span rel="#L15" id="L15"&gt;15&lt;/span&gt; &lt;span rel="#L16" id="L16"&gt;16&lt;/span&gt; &lt;span rel="#L17" id="L17"&gt;17&lt;/span&gt; &lt;span rel="#L18" id="L18"&gt;18&lt;/span&gt; &lt;span rel="#L19" id="L19"&gt;19&lt;/span&gt; &lt;span rel="#L20" id="L20"&gt;20&lt;/span&gt; &lt;span rel="#L21" id="L21"&gt;21&lt;/span&gt; &lt;span rel="#L22" id="L22"&gt;22&lt;/span&gt; &lt;span rel="#L23" id="L23"&gt;23&lt;/span&gt; &lt;span rel="#L24" id="L24"&gt;24&lt;/span&gt; &lt;span rel="#L25" id="L25"&gt;25&lt;/span&gt; &lt;span rel="#L26" id="L26"&gt;26&lt;/span&gt; &lt;span rel="#L27" id="L27"&gt;27&lt;/span&gt; &lt;span rel="#L28" id="L28"&gt;28&lt;/span&gt; &lt;span rel="#L29" id="L29"&gt;29&lt;/span&gt; &lt;span rel="#L30" id="L30"&gt;30&lt;/span&gt; &lt;/pre&gt; &lt;/td&gt; &lt;td width="100%"&gt;   &lt;div class="highlight"&gt;&lt;pre&gt;&lt;/pre&gt;&lt;div class="line" id="LC1"&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyGrailsViewResolver&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;GrailsViewResolver&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC2"&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="line" id="LC3"&gt;    &lt;span class="nd"&gt;@Override&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC4"&gt;    &lt;span class="kd"&gt;protected&lt;/span&gt; &lt;span class="n"&gt;View&lt;/span&gt; &lt;span class="nf"&gt;loadView&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;viewName&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Locale&lt;/span&gt; &lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC5"&gt;        &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;MyView&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;super&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;loadView&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;viewName&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC6"&gt;    &lt;span class="o"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC7"&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="line" id="LC8"&gt;    &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyView&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="n"&gt;View&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC9"&gt;        &lt;span class="n"&gt;def&lt;/span&gt; &lt;span class="n"&gt;View&lt;/span&gt; &lt;span class="n"&gt;view&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC10"&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="line" id="LC11"&gt;        &lt;span class="nf"&gt;MyView&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;View&lt;/span&gt; &lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC12"&gt;            &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;view&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;view&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC13"&gt;        &lt;span class="o"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC14"&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="line" id="LC15"&gt;        &lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="nf"&gt;getContentType&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC16"&gt;            &lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getContentType&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC17"&gt;        &lt;span class="o"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC18"&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="line" id="LC19"&gt;        &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;&lt;&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="o"&gt;?&gt;&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;HttpServletRequest&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;HttpServletResponse&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC20"&gt;            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;categories&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC21"&gt;                &lt;span class="n"&gt;use&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;remove&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="n"&gt;categories&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC22"&gt;                    &lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;render&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC23"&gt;                &lt;span class="o"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC24"&gt;            &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC25"&gt;                &lt;span class="n"&gt;view&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;render&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC26"&gt;            &lt;span class="o"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC27"&gt;        &lt;span class="o"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC28"&gt;    &lt;span class="o"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC29"&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC30"&gt;&lt;br/&gt;&lt;/div&gt;&lt;/div&gt;   &lt;/td&gt; &lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://blog.shenie.info/post/6367521736</link><guid>http://blog.shenie.info/post/6367521736</guid><pubDate>Fri, 10 Jun 2011 09:58:32 +1000</pubDate></item><item><title>Convert GPathResult to String without tag0</title><description>&lt;div class="posterous_autopost"&gt;In Groovy, you can use groovy.xml.XmlUtil.serialize(GPathResult node) &lt;br/&gt;to convert node to XML String.  But sometimes the XML you end up with contains tag0 namespace all over &lt;br/&gt;the elements. It happens because the doc contains default namespace &lt;br/&gt;with empty prefix, so groovy uses a default prefix which is “tag0”. &lt;br/&gt;The XML is still correct but it would be nice to not have to see that &lt;br/&gt;crap. To do so you need to create a new closure with the node and &lt;br/&gt;explicitly declare an empty string namespace. Then use &lt;br/&gt;StreamingMarkupBuilder to convert the newly created closure to String. &lt;br/&gt;The following code is how you would implement that logic. &lt;p&gt;&lt;/p&gt;  
&lt;script src="http://gist.github.com/716310.js"&gt;&lt;/script&gt;&lt;/div&gt;</description><link>http://blog.shenie.info/post/1688099998</link><guid>http://blog.shenie.info/post/1688099998</guid><pubDate>Fri, 26 Nov 2010 16:27:00 +1100</pubDate></item><item><title>Overwrite Inploy app servers' restart command</title><description>&lt;div class="posterous_autopost"&gt;Inploy (&lt;a href="http://github.com/dcrec1/inploy)"&gt;&lt;a href="http://github.com/dcrec1/inploy"&gt;http://github.com/dcrec1/inploy&lt;/a&gt;)&lt;/a&gt; is a rails deployment &lt;br/&gt;solution. It comes with integration to restart 4 app servers: &lt;br/&gt;* mongrel &lt;br/&gt;* passenger &lt;br/&gt;* thin &lt;br/&gt;* unicorn  I needed a way to change how Inploy restarts passenger since our &lt;br/&gt;passenger’s restart file is at a different location. &lt;p&gt;&lt;/p&gt; I could’ve changed the command inside Inploy’s passenger.rb but I &lt;br/&gt;wanted to avoid that as there’s good chance that someone in the future &lt;br/&gt;won’t know to re-apply the change when they upgrade Inploy.  So I needed a way to monkey patch Inploy’s passenger module. My first &lt;br/&gt;attempt was to create my version of the Passenger module and require &lt;br/&gt;the file in rails’ environment.rb. That was no good because Inploy’s &lt;br/&gt;update command does not seem to bootstrap the whole rails environment &lt;br/&gt;so my override simply wasn’t getting loaded. &lt;p&gt;&lt;/p&gt; I had to find another way in to load my module for the deployment &lt;br/&gt;process. It turns out the solution I was looking for is in rake. Since &lt;br/&gt;Inploy’s update is just a rake task, I could create a passenger.rake &lt;br/&gt;in Rails.root/lib/tasks and define my restart_server override inside &lt;br/&gt;my custom passenger.rake.  Please let me know if there is a better / proper way to achieve what I &lt;br/&gt;needed. Otherwise hope this helps someone else.&lt;/div&gt;</description><link>http://blog.shenie.info/post/784714917</link><guid>http://blog.shenie.info/post/784714917</guid><pubDate>Thu, 08 Jul 2010 19:57:38 +1000</pubDate></item><item><title>My shortcut to open any gem in TextMate with 1 command</title><description>Using the &lt;a href="http://blog.peepcode.com/tutorials/2009/shell-method-missing/shell_method_missing.rb"&gt;implementation&lt;/a&gt; from @peepcode’s &lt;a href="http://blog.peepcode.com/tutorials/2009/shell-method-missing"&gt;blog on shell method missing&lt;/a&gt; as a base.&lt;div&gt;I’ve added another action (code snippet below) to open a gem library in TextMate by typing in the name of the gem followed by “.mate”.&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style="font-size: 12px;"&gt;when /^[A-Za-z0-9_-\/]+.mate$/&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 12px;"&gt;  # Open the gem in textmate&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 12px;"&gt;  # @example&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 12px;"&gt;  #   haml.mate&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 12px;"&gt;  gem_to_open = command.first.gsub(/.mate$/, ”)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 12px;"&gt;  run “gem which #{gem_to_open} | tail -1 | xargs dirname | sed -e’s/$/\/../’ | xargs mate”&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;</description><link>http://blog.shenie.info/post/276857071</link><guid>http://blog.shenie.info/post/276857071</guid><pubDate>Thu, 10 Dec 2009 12:42:13 +1100</pubDate></item><item><title>Download sources jar from maven</title><description>&lt;p&gt;We use Maven, when Maven downloads dependencies it doesn’t download sources, which I rely on when learn and debug programs…. &lt;br/&gt;I was expecting, for what seem a simple thing to me, a flag that I can add in maven’s settings files or an option to pass to mvn command…. but I couldn’t find the solution (or anything close to it). Don’t get me wrong, there are solutions out there, but I just feel it is too much hassle for the task.  So I wrote a little script that go thru my repo and downloads any jar that doesn’t have its respective sources :p &lt;br/&gt;&lt;script src="http://gist.github.com/243263.js"&gt;&lt;/script&gt;&lt;/p&gt;</description><link>http://blog.shenie.info/post/257914710</link><guid>http://blog.shenie.info/post/257914710</guid><pubDate>Thu, 26 Nov 2009 17:05:42 +1100</pubDate></item><item><title>ImageMagick and JPEG on OSX</title><description>&lt;p&gt;I am not a fan of port or fink so I always install ImageMagick from source.&lt;/p&gt;

&lt;div&gt;Recently I came across a problem where ImageMagick fails to identify JPEG’s.&lt;/div&gt;

&lt;div&gt;The error looks something like this&lt;/div&gt;

&lt;div&gt;identify: no decode delegate for this image format&lt;/div&gt;



&lt;div&gt;After some digging around it appears I need to install libjpeg and reinstall ImageMagick for JPEG support.&lt;/div&gt;

&lt;div&gt;So I downloaded &lt;a href="http://www.imagemagick.org/download/delegates/jpegsrc.v7.tar.gz"&gt;jpegsrc.v7.tar.gz&lt;/a&gt; and just run thru the standard configure, make &amp; make install then reinstalled ImageMagick.&lt;/div&gt;

&lt;div&gt;After the installation you should be able to see JPEG as one of the supported format via the command ”identify -list format”.&lt;/div&gt;

&lt;div&gt;It should contain something like this.&lt;/div&gt;

&lt;div&gt;     JPEG* JPEG      rw-   Joint Photographic Experts Group JFIF format (70)&lt;p&gt;&lt;/p&gt;&lt;/div&gt;</description><link>http://blog.shenie.info/post/254946528</link><guid>http://blog.shenie.info/post/254946528</guid><pubDate>Tue, 24 Nov 2009 11:52:00 +1100</pubDate></item><item><title>Script Editor</title><description>&lt;p&gt;This is a reminder for myself more than anything.&lt;/p&gt;

&lt;p&gt;To learn what you can do with an application using osascript, you can run Script Editor and click “Open the Application’s Dictionary” to see properties &amp;/methods that are available.&lt;/p&gt;</description><link>http://blog.shenie.info/post/53000659</link><guid>http://blog.shenie.info/post/53000659</guid><pubDate>Sat, 04 Oct 2008 14:58:39 +1000</pubDate><category>apple</category><category>osascript</category><category>scripting</category></item><item><title>Apple did the right thing</title><description>&lt;a href="http://developer.apple.com/iphone/program/"&gt;Apple did the right thing&lt;/a&gt;: &lt;p&gt;NDA dropped for released software&lt;/p&gt;</description><link>http://blog.shenie.info/post/52657214</link><guid>http://blog.shenie.info/post/52657214</guid><pubDate>Thu, 02 Oct 2008 08:08:58 +1000</pubDate></item><item><title>iPhone NDA</title><description>&lt;a href="http://www.onrails.org/articles/2008/09/26/iphone-nda-call-for-arms"&gt;iPhone NDA&lt;/a&gt;: &lt;p&gt;Wonder when is Android powered phones will come to OZ. It’d be fun to write app to run on my own phone :)&lt;/p&gt;</description><link>http://blog.shenie.info/post/52053846</link><guid>http://blog.shenie.info/post/52053846</guid><pubDate>Sun, 28 Sep 2008 07:01:49 +1000</pubDate></item><item><title>Fun with proc</title><description>&lt;a href="http://pragdave.blogs.pragprog.com/pragdave/2008/09/fun-with-procs.html"&gt;Fun with proc&lt;/a&gt;: &lt;p&gt;Curry is going to be a double edged sword.&lt;/p&gt;</description><link>http://blog.shenie.info/post/49489085</link><guid>http://blog.shenie.info/post/49489085</guid><pubDate>Wed, 10 Sep 2008 11:29:00 +1000</pubDate><category>ruby</category></item><item><title>git survey</title><description>&lt;p&gt;Some of the commands in the &lt;a href="http://www.survs.com/survey?id=M3PIVU72&amp;channel=2WXE4BVTW8"&gt;survey&lt;/a&gt; looks interesting, must find time to learn them.&lt;/p&gt;

&lt;pre&gt;
git add -i / -p
git add -u / -A
git am
git am -i
git apply
git apply --whitespace=fix
git archive
git bisect
git bisect run &lt;cmd&gt;
git annotate
git gui blame
git blame
git blame -L &lt;start&gt;,&lt;end&gt; etc.
git bundle
git cherry
git cherry-pick
git cherry-pick -n
git citool
git clean
git add + git commit
git commit -a
git commit &lt;file&gt;...
git commit -i &lt;file&gt;...
git commit --amend
git cvsexportcommit
git cvsserver
git daemon
git daemon (pushing enabled)
git ... --dirstat
git fetch [&lt;options&gt;]
git filter-branch
git format-patch
git grep
git imap-send
git instaweb
git log --grep/--author/...
git log -S&lt;string&gt; (pickaxe search)
git log --graph
git merge
git merge with strategy
git merge --squash
git mergetool
git pull (no remote)
git pull --rebase [&lt;options&gt;]
git pull &lt;remote&gt;
git pull &lt;url&gt;&lt;ref&gt;
git push
git relink
git rebase
git rebase -i
git remote
git remote update
git request-pull
git revert
git send-email
git show-branch
git shortlog
git shortlog -s
git stash
git stash --keep-index
git submodule
git svn
git whatchanged
git gui
gitk
&lt;/ref&gt;&lt;/url&gt;&lt;/remote&gt;&lt;/options&gt;&lt;/string&gt;&lt;/options&gt;&lt;/file&gt;&lt;/file&gt;&lt;/end&gt;&lt;/start&gt;&lt;/cmd&gt;&lt;/pre&gt;</description><link>http://blog.shenie.info/post/48278724</link><guid>http://blog.shenie.info/post/48278724</guid><pubDate>Tue, 02 Sep 2008 00:48:00 +1000</pubDate><category>git</category><category>scm</category></item><item><title>Jar decompiler</title><description>&lt;p&gt;A while ago I posted some shell scripts to decompile java classes.&lt;/p&gt;

&lt;p&gt;I decided to re-implement it in &lt;a href="http://github.com/shenie/jar_decompiler/tree/master"&gt;ruby&lt;/a&gt; so I can use it between my work (Windows) and home (OS X) machines.&lt;/p&gt;

&lt;p&gt;This version does not require you to extract the class files first. You simply pass the jar file to the script and it’ll decompress and decompile it into a directory with the same name as the jar file without .jar.&lt;/p&gt;</description><link>http://blog.shenie.info/post/41045341</link><guid>http://blog.shenie.info/post/41045341</guid><pubDate>Sat, 05 Jul 2008 16:11:11 +1000</pubDate><category>jar</category><category>jad</category><category>class</category><category>decompile</category><category>ruby</category><category>github</category></item><item><title>Twitter's auto follow script in ruby</title><description>&lt;a href="http://github.com/shenie/auto_follow/tree/master"&gt;Twitter's auto follow script in ruby&lt;/a&gt;: &lt;p&gt;As requested by &lt;a href="http://twitter.com/joshowens/statuses/846051862"&gt;Josh&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.shenie.info/post/40677121</link><guid>http://blog.shenie.info/post/40677121</guid><pubDate>Wed, 02 Jul 2008 21:28:55 +1000</pubDate></item><item><title>How to map a network drive</title><description>&lt;pre&gt;
net use x: \\{server}\d$  /USER:{server}\{username} {password}
&lt;/pre&gt;

&lt;p&gt;Basically says you want to map d: drive on {server} to your x: drive as the {username}, which is a login locally on {server}&lt;/p&gt;</description><link>http://blog.shenie.info/post/40403520</link><guid>http://blog.shenie.info/post/40403520</guid><pubDate>Mon, 30 Jun 2008 21:37:28 +1000</pubDate><category>windows</category><category>net</category><category>network</category></item><item><title>Apple &amp; Google's open web efforts</title><description>&lt;a href="http://www.roughlydrafted.com/2008/06/14/cocoa-for-windows-flash-killer-sproutcore/"&gt;Apple &amp; Google's open web efforts&lt;/a&gt;</description><link>http://blog.shenie.info/post/40011246</link><guid>http://blog.shenie.info/post/40011246</guid><pubDate>Fri, 27 Jun 2008 15:07:10 +1000</pubDate><category>google</category><category>apple</category><category>vm</category><category>openweb</category></item><item><title>How to decompile everything</title><description>&lt;p&gt;Quick script to decompile all the class files.&lt;/p&gt;

&lt;pre&gt;
find . -name "*.class" -not -name "*\$*" | while read class
do
  dir=`dirname $class`
  file=`basename $class .class`
  pushd $dir &gt;/dev/null
  jad -p ${file}.class &gt; ${file}.java
  popd &gt;/dev/null
done
&lt;/pre&gt;</description><link>http://blog.shenie.info/post/38256383</link><guid>http://blog.shenie.info/post/38256383</guid><pubDate>Fri, 13 Jun 2008 21:30:05 +1000</pubDate><category>java</category><category>scripting</category><category>shell</category><category>decompile</category></item><item><title>WOW! scary but pretty.</title><description>&lt;img src="http://25.media.tumblr.com/Rp426TxkO9vwceijixVk7kgR_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;WOW! scary but pretty.&lt;/p&gt;</description><link>http://blog.shenie.info/post/37358925</link><guid>http://blog.shenie.info/post/37358925</guid><pubDate>Fri, 06 Jun 2008 15:39:24 +1000</pubDate><category>interesting</category></item><item><title>OS X's ruby framework</title><description>&lt;p&gt;I think new version of ruby is meant to be installed with the following prefix, using 1.8.7 as an example.&lt;/p&gt;

&lt;p&gt;/System/Library/Frameworks/Ruby.framework/Versions/1.8.7/usr&lt;/p&gt;

&lt;p&gt;That way you can just /System/Library/Frameworks/Ruby.framework/Versions/Current to the version you want.&lt;/p&gt;</description><link>http://blog.shenie.info/post/37270901</link><guid>http://blog.shenie.info/post/37270901</guid><pubDate>Thu, 05 Jun 2008 23:15:00 +1000</pubDate><category>ruby</category><category>os x</category></item><item><title>How to revert back to os x ruby framework</title><description>&lt;p&gt;As I mentioned before, I upgraded to ruby 1.8.7 and decided to use —prefix=/usr, i.e. overwriting existing ruby 1.8.6. Big mistake. After some issues I decided to roll back completely.&lt;/p&gt;

&lt;p&gt;This is what I did (luckily I can copy the required files from my wife’s Macbook).&lt;/p&gt;

&lt;h3&gt;OS X ruby framework overview&lt;/h3&gt;

&lt;p&gt;The framework is /System/Library/Frameworks/Ruby.framework&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;/usr/lib/ruby is a softlink to osx ruby framework&lt;/li&gt;
&lt;li&gt;osx ruby framework’s site_ruby is a softlinke to /Library/Ruby/Site&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;To fix&lt;/h3&gt;

&lt;ul&gt;&lt;li&gt;/usr/bin&lt;/li&gt;
&lt;li&gt;osx ruby framework&lt;/li&gt;
&lt;li&gt;/Library/Ruby/Site&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Actions&lt;/h3&gt;

&lt;p&gt;Rename the following directories then copy the same directories from another OS X&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;/System/Library/Frameworks/Ruby.framework&lt;/li&gt;
&lt;li&gt;/Library/Ruby/Site&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Make sure the following files are links to os x ruby framework’s /usr/bin&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;/usr/bin/erb&lt;/li&gt;
&lt;li&gt;/usr/bin/irb&lt;/li&gt;
&lt;li&gt;/usr/bin/rdoc&lt;/li&gt;
&lt;li&gt;/usr/bin/ri&lt;/li&gt;
&lt;li&gt;/usr/bin/ruby&lt;/li&gt;
&lt;li&gt;/usr/bin/testrb&lt;/li&gt;
&lt;/ul&gt;&lt;h3&gt;Cleanup&lt;/h3&gt;

&lt;p&gt;Remove these backup directories afterwards (once everything is ok)&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;os x ruby framework .bak&lt;/li&gt;
&lt;li&gt;/Library/Ruby/Site.bak&lt;/li&gt;
&lt;li&gt;/usr/lib/ruby/site_ruby.bak&lt;/li&gt;
&lt;li&gt;/usr/lib/ruby/user-gems.bak&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Now&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;link /usr/lib/ruby/site_ruby to /Library/Ruby/Site&lt;/li&gt;
&lt;li&gt;link /usr/lib/ruby/user-gems to /Library/Ruby/Gems&lt;/li&gt;
&lt;/ul&gt;</description><link>http://blog.shenie.info/post/37270385</link><guid>http://blog.shenie.info/post/37270385</guid><pubDate>Thu, 05 Jun 2008 23:10:21 +1000</pubDate><category>ruby</category><category>osx</category></item></channel></rss>

