<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>uRaNGaTaNG &#187; Happy Hacking</title>
	<atom:link href="http://www.rngtng.com/category/happy-hacking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rngtng.com</link>
	<description>Featuring Ruby, Rails, Web development, Arduino, Processing, Nabaztag and more...</description>
	<lastBuildDate>Thu, 12 Jan 2012 10:08:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://www.rngtng.com/?pushpress=hub'/>
		<item>
		<title>Sugru rocks! Or: how I fixed my broken iPhone Display glass from falling off.</title>
		<link>http://www.rngtng.com/2011/11/08/sugru-rocks-how-i-fixed-my-broken-iphone-display-glass-from-falling-off/</link>
		<comments>http://www.rngtng.com/2011/11/08/sugru-rocks-how-i-fixed-my-broken-iphone-display-glass-from-falling-off/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 10:52:36 +0000</pubDate>
		<dc:creator>tobi</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[sugru]]></category>

		<guid isPermaLink="false">http://www.rngtng.com/?p=597</guid>
		<description><![CDATA[Unfortunately I kept on dropping my iPhone until its display glass broke. Typical me. But after that, even worse, the little bits of broken glass where loose, slowly felt off one after another destroying the displays protection completely. Whereas the drop (besides the broken glass) didn't effect the phones functionaries at all (even its ...]]></description>
			<content:encoded><![CDATA[<p>Unfortunately I kept on dropping my iPhone until its display glass broke. Typical me. But after that, even worse, the little bits of broken glass where loose, slowly felt off one after another destroying the displays protection completely. Whereas the drop (besides the broken glass) didn&#8217;t effect the phones functionaries at all (even its touch capabilities are 100% working), the vanishing glass revealed the display which could get destroyed by dust and moist easily. Luckily I found a solution: Sugru.</p>
<p>Sugru is this fantastic super modeling clay made by Jane from Ireland. It allows you to hack the world and fix stuff. First its soft, sticks on nearly and material allowing you to put it in any shape, later it hardens and keeps its form. Perfect for me!</p>
<p><img class="aligncenter size-full wp-image-599" src="http://www.rngtng.com/files/2011/11/20111108-f8j49y7mhtxjenh57c3swnciwe.jpg" alt="" width="596" height="337" /></p>
<p>Check my hack, where I used Sugru replacing the missing glass pieces and preventing the loose ones from falling of. My display is protected again, and the phone is working &#8211; yay!</p>
<p>Visit the Sugru Website and get some for yourself: <a href="http://sugru.com" target="_blank">http://sugru.com</a></p>
<p class="wp-flattr-button"></p> <p><a href="http://www.rngtng.com/?flattrss_redirect&amp;id=597&amp;md5=831766ada6a818bfa72d60448ebcde49" title="Flattr" target="_blank"><img src="http://www.rngtng.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.rngtng.com/2011/11/08/sugru-rocks-how-i-fixed-my-broken-iphone-display-glass-from-falling-off/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Long time ago: &#8216;Die besten JavaScripts &#8211; SizeIt!&#8217;</title>
		<link>http://www.rngtng.com/2011/08/12/long-time-ago-die-besten-javascripts-sizeit/</link>
		<comments>http://www.rngtng.com/2011/08/12/long-time-ago-die-besten-javascripts-sizeit/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 16:10:37 +0000</pubDate>
		<dc:creator>tobi</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[sizeit]]></category>

		<guid isPermaLink="false">http://www.rngtng.com/?p=573</guid>
		<description><![CDATA[Wuhooo, look what I found in my archives:



In my early webdeveloper days I created a small javascript which named 'SizeIt!'. It purpose was to resize all website elements according to the size of users viewpoint. So regardless which screen resolution the user has, the website propotions would always be the same. Honestly, it worked ...]]></description>
			<content:encoded><![CDATA[<p>Wuhooo, look what I found in my archives:</p>
<p><a href='http://www.rngtng.com/files/2011/07/js.pdf'><img src="http://www.rngtng.com/files/2011/07/Screen-shot-2011-07-23-at-18.16.26.png" alt="" width="352" height="498" class="aligncenter size-full wp-image-575" /></a></p>
<p>In my early webdeveloper days I created a small javascript which named &#8216;SizeIt!&#8217;. It purpose was to resize all website elements according to the size of users viewpoint. So regardless which screen resolution the user has, the website propotions would always be the same. Honestly, it worked only in very special cases and was slooooow (these days) <img src='http://www.rngtng.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But the idea was great and it even gave me second place in a competition &#8211; &#8216;Die besten JavaScripts&#8217; of Internet-World in August 2000. <a href='http://www.rngtng.com/files/2011/07/js.pdf'>Read the result here</a> (german only, sorry).</p>
<p>Not sure where I do have source code, will continue searching archive and post it here someday &#8211; stay tuned &#8230;</p>
<p class="wp-flattr-button"></p> <p><a href="http://www.rngtng.com/?flattrss_redirect&amp;id=573&amp;md5=a979104c5d81c193465281ac0726fad3" title="Flattr" target="_blank"><img src="http://www.rngtng.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.rngtng.com/2011/08/12/long-time-ago-die-besten-javascripts-sizeit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Meet me at Chaos Communication Camp 2011</title>
		<link>http://www.rngtng.com/2011/08/02/meet-me-at-chaos-communication-camp-2011/</link>
		<comments>http://www.rngtng.com/2011/08/02/meet-me-at-chaos-communication-camp-2011/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 08:01:24 +0000</pubDate>
		<dc:creator>tobi</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[camp]]></category>
		<category><![CDATA[ccc]]></category>
		<category><![CDATA[hacking]]></category>

		<guid isPermaLink="false">http://www.rngtng.com/?p=588</guid>
		<description><![CDATA[Yay, I'll be at CCC Camp 2011 - and for sure I'll bring my arduino/rainbowduino stuff with me. So come over, say hello and join in the crazy hackingingz!



http://events.ccc.de/camp/2011/]]></description>
			<content:encoded><![CDATA[<p>Yay, I&#8217;ll be at CCC Camp 2011 &#8211; and for sure I&#8217;ll bring my arduino/rainbowduino stuff with me. So come over, say hello and join in the crazy hackingingz!</p>
<p><a href="http://www.rngtng.com/2011/08/02/meet-me-at-chaos-communication-camp-2011/"><em>Click here to view the embedded video.</em></a></p>
<p><a href="http://events.ccc.de/camp/2011/" target="_blank">http://events.ccc.de/camp/2011/</a></p>
<p class="wp-flattr-button"></p> <p><a href="http://www.rngtng.com/?flattrss_redirect&amp;id=588&amp;md5=d1940a7e812f6225d52cd2b32f86fa1c" title="Flattr" target="_blank"><img src="http://www.rngtng.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.rngtng.com/2011/08/02/meet-me-at-chaos-communication-camp-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Talk: Short introduction to Rainbowduino and mtXcontol</title>
		<link>http://www.rngtng.com/2011/07/23/talk-short-introduction-to-rainbowduino-and-mtxcontol/</link>
		<comments>http://www.rngtng.com/2011/07/23/talk-short-introduction-to-rainbowduino-and-mtxcontol/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 15:53:30 +0000</pubDate>
		<dc:creator>tobi</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[berlin]]></category>
		<category><![CDATA[cbase]]></category>
		<category><![CDATA[hack and tell]]></category>
		<category><![CDATA[RainbowDuino]]></category>
		<category><![CDATA[talk]]></category>

		<guid isPermaLink="false">http://www.rngtng.com/?p=559</guid>
		<description><![CDATA[I gave a short talk at Hack and Tell in Berlin. I briefly introduced the Rainbowduino device and my work on mtXcontol. Watch me here:



Here are the slides:
http://www.slideshare.net/rngtng/rainbowduino

Thanks to David for recording!]]></description>
			<content:encoded><![CDATA[<p>I gave a short talk at <a href="http://www.meetup.com/berlin-hack-and-tell">Hack and Tell</a> in Berlin. I briefly introduced the Rainbowduino device and my work on mtXcontol. Watch me here:</p>
<p><a href="http://www.rngtng.com/2011/07/23/talk-short-introduction-to-rainbowduino-and-mtxcontol/"><em>Click here to view the embedded video.</em></a></p>
<p>Here are the slides:</p>
<p><a href="http://www.slideshare.net/rngtng/rainbowduino" target="_blank">http://www.slideshare.net/rngtng/rainbowduino</a></p>
<p>Thanks to David for recording!</p>
<p class="wp-flattr-button"></p> <p><a href="http://www.rngtng.com/?flattrss_redirect&amp;id=559&amp;md5=36fb2267ffea58cdeffe3cceb75a25c0" title="Flattr" target="_blank"><img src="http://www.rngtng.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.rngtng.com/2011/07/23/talk-short-introduction-to-rainbowduino-and-mtxcontol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optical Illusion: a non straight line of code?</title>
		<link>http://www.rngtng.com/2011/06/24/optical-illusion-a-non-straight-line-of-code/</link>
		<comments>http://www.rngtng.com/2011/06/24/optical-illusion-a-non-straight-line-of-code/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 11:23:13 +0000</pubDate>
		<dc:creator>tobi</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[jedit]]></category>

		<guid isPermaLink="false">http://www.rngtng.com/?p=551</guid>
		<description><![CDATA[A bit of fun: Look at this, a Screenshot I took ages ago and just found to share. It's taken from a piece of code I was writing within jEdit by that time.



 It totally looks like the two long line go up, but if you apply a ruler, you see, it's indeed straight:



 ...]]></description>
			<content:encoded><![CDATA[<p>A bit of fun: Look at this, a Screenshot I took ages ago and just found to share. It&#8217;s taken from a piece of code I was writing within <a href="http://www.jedit.org/">jEdit</a> by that time.</p>
<p><img src="http://www.rngtng.com/files/2011/06/php-code-schief.jpg" alt="" width="550" height="163" class="aligncenter size-full wp-image-552" /></p>
<p> It totally looks like the two long line go up, but if you apply a ruler, you see, it&#8217;s indeed straight:<br />
<img src="http://www.rngtng.com/files/2011/06/20110624-82aa2bmbrwc3d47akjt53heja3.jpg" alt="" width="562" height="173" class="aligncenter size-full wp-image-555" /></p>
<p> A optical Illusion &#8211; weird, right?</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.rngtng.com/2011/06/24/optical-illusion-a-non-straight-line-of-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HowTo: parse invalid, irregular HTML having &lt; or unlcosed tags</title>
		<link>http://www.rngtng.com/2011/02/03/pars-invalid-irregular-html-with-unclosed-tag/</link>
		<comments>http://www.rngtng.com/2011/02/03/pars-invalid-irregular-html-with-unclosed-tag/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 11:24:48 +0000</pubDate>
		<dc:creator>tobi</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[invlaid]]></category>
		<category><![CDATA[irregular]]></category>
		<category><![CDATA[nokogiri]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[Ruby, Rails & Co.]]></category>
		<category><![CDATA[tag]]></category>

		<guid isPermaLink="false">http://www.rngtng.com/?p=529</guid>
		<description><![CDATA[I had the 'problem' that user feedback included lot of love - mostly by writing 'hearts'. Unfortunately expressing hearts is done by '&#60;3&#039; which turns the input into invalid HTML. Bummer. So if you still want allow other basic tags, you have a problem. Here&#039;s how I solved it:

First I checked Stackoverflow - Tian ...]]></description>
			<content:encoded><![CDATA[<p>I had the &#8216;problem&#8217; that user feedback included lot of love &#8211; mostly by writing &#8216;hearts&#8217;. Unfortunately expressing hearts is done by &#8216;&lt;3&#039; which turns the input into invalid HTML. Bummer. So if you still want allow other basic tags, you have a problem. Here&#039;s how I solved it:</p>
<p>First I checked Stackoverflow &#8211; <strong>Tian</strong> had similar problem over there: <a href="http://stackoverflow.com/questions/3268387/nokogiri-parsing-irregular">Nokogiri: Parsing Irregular &lt;</a></p>
<p>As a quick fix I came up with this method using a reqular expression to identify unclosed tags:</p>
<pre class="brush: plain; title: ; notranslate">
def fix_irregular_html(html)
  regexp = /&lt;([^&lt;&gt;]*)(&lt;|$)/

  #we need to do this multiple time as regex are overlapping
  while (fixed_html = html.gsub(regexp, &quot;&amp;lt;\\1\\2&quot;)) &amp;&amp; fixed_html != html
    html = fixed_html
  end

  fixed_html
end
</pre>
<p>See full code including test here: <a href="https://gist.github.com/796571" target="_blank">https://gist.github.com/796571</a></p>
<p>It works out well for me, I appreciate any feedback and improvements</p>
<p>See full code and test here:</p>
<p><a href="https://gist.github.com/796571" target="_blank">https://gist.github.com/796571</a></p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.rngtng.com/2011/02/03/pars-invalid-irregular-html-with-unclosed-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OS X Terminal: visual indication for your ssh connection</title>
		<link>http://www.rngtng.com/2011/01/14/mac-os-x-terminal-visual-indication-for-your-ssh-connection/</link>
		<comments>http://www.rngtng.com/2011/01/14/mac-os-x-terminal-visual-indication-for-your-ssh-connection/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 09:18:19 +0000</pubDate>
		<dc:creator>tobi</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[indicator]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.rngtng.com/?p=508</guid>
		<description><![CDATA[
Here's a HowTo for a nice visual indication to see quickly if your Mac OS X Terminal is running which ssh connection.

The trick is to change your Terminal Theme before you ssh and change it back afterwards.

1. Create Theme:
got to   Terminal -&#62; Preferences -&#62; Settings   create a new theme (or ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-512 aligncenter" title="Screen shot 2011-01-14 at 10.14.45" src="http://www.rngtng.com/files/2011/01/Screen-shot-2011-01-14-at-10.14.45.png" alt="" width="593" height="427" /></p>
<p>Here&#8217;s a HowTo for a nice visual indication to see quickly if your Mac OS X Terminal is running which ssh connection.</p>
<p>The trick is to change your Terminal Theme before you ssh and change it back afterwards.</p>
<p><strong>1. Create Theme:</strong><br />
got to   Terminal -&gt; Preferences -&gt; Settings   create a new theme (or copy existing one) and adjust to your needs, e.g. a light red background etc. Give it a nice name e.g. &#8220;SSH-Theme&#8221;</p>
<p><strong>2. Add this function to your .bashrc</strong></p>
<p><code>function tabc() {<br />
NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi<br />
osascript -e "tell application \"Terminal\" to set current settings of front window to settings set \"$NAME\""<br />
}</code></p>
<p>&#8220;Default&#8221; is my default Terminal theme, name this whatever u have</p>
<p><em>Usage:</em><br />
<code>tabc SSH-Theme  #switch to theme with name<br />
tabc  #switch to default theme</code></p>
<p><strong>3. Create alias to ssh to server:</strong></p>
<p><code> alias sshmyserver="tabc SSH-Theme; ssh yourserver.com; tabc"</code></p>
<p>That&#8217;s it &#8211; your are done! Now, if you type <code>sshmyserver</code>, your Terminal color will change, ssh will start, and when you end ssh, everything will be back again..</p>
<p>Btw. for Terminal on Mac OS X, I very recommend <a href="http://www.rngtng.com/2009/08/14/quake-like-terminal-on-mac-os-x-visor-plugin/" class="broken_link">Visor &#8211; a quake like console</a></p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.rngtng.com/2011/01/14/mac-os-x-terminal-visual-indication-for-your-ssh-connection/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>cubeXcontrol &#8211; a Rainbow Cube Editor</title>
		<link>http://www.rngtng.com/2010/12/31/cubexcontrol-a-rainbow-cube-editor/</link>
		<comments>http://www.rngtng.com/2010/12/31/cubexcontrol-a-rainbow-cube-editor/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 13:35:15 +0000</pubDate>
		<dc:creator>tobi</dc:creator>
				<category><![CDATA[Arduino & Co.]]></category>
		<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[carnival]]></category>
		<category><![CDATA[cube]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[RainbowCube]]></category>
		<category><![CDATA[RainbowDuino]]></category>
		<category><![CDATA[RGB]]></category>
		<category><![CDATA[seeedstudio]]></category>

		<guid isPermaLink="false">http://www.rngtng.com/?p=501</guid>
		<description><![CDATA[

UPDATE:
Please express your Love and vote for cubeXControl here - Thanks!

UPDATE2:
Apparently the current Version doesn't work with Windows. I'm very sorry for that, but at the moment I don't have any Win machine to test this. So please feel free to try yourself and fix it! Thx!

I'm proud to present a first version which ...]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.rngtng.com/files/2010/12/cube.jpg" alt="" width="500" height="340" class="aligncenter size-full wp-image-504" /></p>
<p><strong>UPDATE:</strong><br />
<a href="http://www.seeedstudio.com/blog/2011/01/14/rainbowduino-carnival-2010-vote-now/">Please express your Love and vote for <strong>cubeXControl</strong> here &#8211; Thanks!</a></p>
<p><strong>UPDATE2:</strong><br />
Apparently the current Version doesn&#8217;t work with Windows. I&#8217;m very sorry for that, but at the moment I don&#8217;t have any Win machine to test this. So please feel free to try yourself and fix it! Thx!</p>
<p>I&#8217;m proud to present a first version which was on my this years TODO list for so long, but due to all the changes therefore very less time never got startet. But thanks to the <a href="http://www.seeedstudio.com/blog/2010/10/28/rainbowduino-carnival-2010-launched/">Seeedstudio Rainbowduino Carnival 2010</a> I got a big motivation boost and found some time to get my fingers dirty again. So check this out, my this years contribution for the carnival:</p>
<p>cubeXcontrol &#8211; a Rainbow Cube Editor</p>
<p>Well, you know the <a href="http://www.rngtng.com/mtXcontrol">mtXcontrol</a>, the Rainbowduino Editor and the awesome <a href="http://www.seeedstudio.com/depot/rainbow-cube-kit-rgb-4x4x4-rainbowduino-compatible-p-596.html">Seeedstudio Rainbow Cube</a> I <a href="http://www.rngtng.com/2010/03/08/rainbow-cube-here-it-is/" class="broken_link">mentioned</a> here ? Now it&#8217;s time  to bring them together:</p>
<p><a href="http://www.rngtng.com/2010/12/31/cubexcontrol-a-rainbow-cube-editor/"><em>Click here to view the embedded video.</em></a></p>
<p>cubeXcontrol is an editor to control and create patterns for the 4x4x4 RGB Rainbow Cube powered by a rainbowduino. It comes with an extra window showing a 3D model of the Cube, allowing to rotate in all directions and to zoom. Click on boxes to set the LED color easily.</p>
<p>The editor is of course heavily based on the latest mtXcontrol version, with the latest rainbowduino firmware. Both are unfortunately still in <a href="http://www.rngtng.com/2010/09/05/mtxcontrol-sneak-preview-rainbowduino-beta-library-master-and-slave/" class="broken_link">beta stage</a>, but come with great new features like auto port detection. </p>
<p>Get the sources here:</p>
<p><a href="https://github.com/rngtng/mtXcontrol/tree/cubeXcontrol" target="_blank">https://github.com/rngtng/mtXcontrol/tree/cubeXcontrol</a></p>
<p>And the Rainbowduino driver:</p>
<p><a href="https://github.com/rngtng/rainbowduino/tree/master_slave" target="_blank">https://github.com/rngtng/rainbowduino/tree/master_slave</a></p>
<p>Happy cub&#8217;ing!</p>
<p class="wp-flattr-button"></p> <p><a href="http://www.rngtng.com/?flattrss_redirect&amp;id=501&amp;md5=64eed6560866b27429a62747504dcc70" title="Flattr" target="_blank"><img src="http://www.rngtng.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.rngtng.com/2010/12/31/cubexcontrol-a-rainbow-cube-editor/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>AppleScript to create keyboard shortcuts</title>
		<link>http://www.rngtng.com/2010/10/29/applescript-to-create-keyboard-shortcuts/</link>
		<comments>http://www.rngtng.com/2010/10/29/applescript-to-create-keyboard-shortcuts/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 09:38:47 +0000</pubDate>
		<dc:creator>tobi</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[shortcut]]></category>
		<category><![CDATA[system]]></category>

		<guid isPermaLink="false">http://www.rngtng.com/?p=490</guid>
		<description><![CDATA[Last week my company laptop got stolen, so I had to setup my system again using this list. The positive part of each new system setup is you think more and more how to automate your setup..

This time I was really annoyed with setting up keyboard shortcuts, so I came up with this little ...]]></description>
			<content:encoded><![CDATA[<p>Last week my company laptop got stolen, so I had to setup my system again using this <a href="http://www.rngtng.com/2010/04/27/my-snow-leopard-development-system-ruby-rails-arduino-co/" class="broken_link">list</a>. The positive part of each new system setup is you think more and more how to automate your setup..</p>
<p>This time I was really annoyed with setting up keyboard shortcuts, so I came up with this little AppleScript which does the work:</p>
<div id="gist-652031" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><span class="c">----------------------------------------------------------------------------------------------------</span></div><div class='line' id='LC2'><span class="c">-- </span></div><div class='line' id='LC3'><span class="c">--   Script to automate creation of Keyborad shortcuts</span></div><div class='line' id='LC4'><span class="c">-- </span></div><div class='line' id='LC5'><span class="c">----------------------------------------------------------------------------------------------------</span></div><div class='line' id='LC6'><span class="nv">GUIScripting_status</span><span class="p">()</span></div><div class='line' id='LC7'><br/></div><div class='line' id='LC8'><span class="k">tell</span> <span class="nb">application</span> <span class="s2">&quot;System Preferences&quot;</span></div><div class='line' id='LC9'>	<span class="nb">activate</span></div><div class='line' id='LC10'>	<span class="nv">reveal</span> <span class="nv">anchor</span> <span class="s2">&quot;shortcutsTab&quot;</span> <span class="k">of</span> <span class="nv">pane</span> <span class="na">id</span> <span class="s2">&quot;com.apple.preference.keyboard&quot;</span></div><div class='line' id='LC11'><span class="k">end</span> <span class="k">tell</span></div><div class='line' id='LC12'><br/></div><div class='line' id='LC13'><span class="k">set</span> <span class="p">{</span><span class="nv">leftArrow</span><span class="p">,</span> <span class="nv">rightArrow</span><span class="p">}</span> <span class="k">to</span> <span class="p">{</span><span class="nb">ASCII character</span> <span class="mi">28</span><span class="p">,</span> <span class="nb">ASCII character</span> <span class="mi">29</span><span class="p">}</span></div><div class='line' id='LC14'><span class="k">set</span> <span class="p">{</span><span class="nv">upArrow</span><span class="p">,</span> <span class="nv">downArrow</span><span class="p">}</span> <span class="k">to</span> <span class="p">{</span><span class="nb">ASCII character</span> <span class="mi">30</span><span class="p">,</span> <span class="nb">ASCII character</span> <span class="mi">31</span><span class="p">}</span></div><div class='line' id='LC15'><br/></div><div class='line' id='LC16'><span class="c">-------------------------------- DEFINE YOUR SHORTCUTS HERE --------------------------------</span></div><div class='line' id='LC17'><br/></div><div class='line' id='LC18'><span class="nv">createShortcut</span><span class="p">(</span><span class="s2">&quot;Safari&quot;</span><span class="p">,</span> <span class="s2">&quot;Select Next Tab&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nb">control</span> <span class="nv">down</span><span class="p">,</span> <span class="nv">rightArrow</span><span class="p">})</span></div><div class='line' id='LC19'><span class="nv">createShortcut</span><span class="p">(</span><span class="s2">&quot;Safari&quot;</span><span class="p">,</span> <span class="s2">&quot;Select Previous Tab&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nb">control</span> <span class="nv">down</span><span class="p">,</span> <span class="nv">leftArrow</span><span class="p">})</span></div><div class='line' id='LC20'><br/></div><div class='line' id='LC21'><span class="nv">createShortcut</span><span class="p">(</span><span class="s2">&quot;Utilities/Terminal&quot;</span><span class="p">,</span> <span class="s2">&quot;Select Next Tab&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nb">control</span> <span class="nv">down</span><span class="p">,</span> <span class="nv">rightArrow</span><span class="p">})</span></div><div class='line' id='LC22'><span class="nv">createShortcut</span><span class="p">(</span><span class="s2">&quot;Utilities/Terminal&quot;</span><span class="p">,</span> <span class="s2">&quot;Select Previous Tab&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nb">control</span> <span class="nv">down</span><span class="p">,</span> <span class="nv">leftArrow</span><span class="p">})</span></div><div class='line' id='LC23'><br/></div><div class='line' id='LC24'><span class="nv">createShortcut</span><span class="p">(</span><span class="s2">&quot;TextMate&quot;</span><span class="p">,</span> <span class="s2">&quot;Next File Tab&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nb">control</span> <span class="nv">down</span><span class="p">,</span> <span class="nv">rightArrow</span><span class="p">})</span></div><div class='line' id='LC25'><span class="nv">createShortcut</span><span class="p">(</span><span class="s2">&quot;TextMate&quot;</span><span class="p">,</span> <span class="s2">&quot;Previous File Tab&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nb">control</span> <span class="nv">down</span><span class="p">,</span> <span class="nv">leftArrow</span><span class="p">})</span></div><div class='line' id='LC26'><span class="nv">createShortcut</span><span class="p">(</span><span class="s2">&quot;TextMate&quot;</span><span class="p">,</span> <span class="s2">&quot;Search Project With AckMate...&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nv">command</span> <span class="nv">down</span><span class="p">,</span> <span class="s2">&quot;F&quot;</span><span class="p">})</span></div><div class='line' id='LC27'><br/></div><div class='line' id='LC28'><span class="c">----------------------------------------------------------------------------------------------------</span></div><div class='line' id='LC29'><br/></div><div class='line' id='LC30'><span class="k">tell</span> <span class="nb">application</span> <span class="s2">&quot;System Preferences&quot;</span> <span class="k">to</span> <span class="nb">quit</span></div><div class='line' id='LC31'><br/></div><div class='line' id='LC32'><span class="c">----------------------------------------------------------------------------------------------------</span></div><div class='line' id='LC33'><span class="c">----------------------------------------------------------------------------------------------------</span></div><div class='line' id='LC34'><br/></div><div class='line' id='LC35'><span class="k">on</span> <span class="nv">createShortcut</span><span class="p">(</span><span class="nv">app_path</span><span class="p">,</span> <span class="nv">menu_text</span><span class="p">,</span> <span class="nv">keystokes</span><span class="p">)</span></div><div class='line' id='LC36'>	<span class="k">tell</span> <span class="nb">application</span> <span class="s2">&quot;System Events&quot;</span></div><div class='line' id='LC37'>		<span class="k">tell</span> <span class="nv">process</span> <span class="s2">&quot;System Preferences&quot;</span></div><div class='line' id='LC38'>			<span class="k">tell</span> <span class="na">window</span> <span class="s2">&quot;Keyboard&quot;</span></div><div class='line' id='LC39'>				<span class="nv">click</span> <span class="nb">button</span> <span class="mi">3</span> <span class="k">of</span> <span class="no">tab</span> <span class="nv">group</span> <span class="mi">1</span></div><div class='line' id='LC40'>				<span class="k">tell</span> <span class="na">sheet</span> <span class="mi">1</span></div><div class='line' id='LC41'>					<span class="nv">click</span> <span class="nv">pop</span> <span class="nv">up</span> <span class="nb">button</span> <span class="mi">1</span></div><div class='line' id='LC42'>					<span class="nv">click</span> <span class="nb">last</span> <span class="na">menu</span> <span class="nb">item</span> <span class="k">of</span> <span class="na">menu</span> <span class="mi">1</span> <span class="k">of</span> <span class="nv">pop</span> <span class="nv">up</span> <span class="nb">button</span> <span class="mi">1</span></div><div class='line' id='LC43'>					<span class="nv">keystroke</span> <span class="s2">&quot;/Applications/&quot;</span> <span class="o">&amp;</span> <span class="nv">app_path</span> <span class="o">&amp;</span> <span class="s2">&quot;.app&quot;</span></div><div class='line' id='LC44'>					<span class="nv">keystroke</span> <span class="no">return</span></div><div class='line' id='LC45'>					<span class="nv">keystroke</span> <span class="no">return</span></div><div class='line' id='LC46'>					<span class="nb">delay</span> <span class="mi">1</span></div><div class='line' id='LC47'><br/></div><div class='line' id='LC48'>					<span class="nv">keystroke</span> <span class="nv">menu_text</span></div><div class='line' id='LC49'>					<span class="nv">keystroke</span> <span class="no">tab</span></div><div class='line' id='LC50'><br/></div><div class='line' id='LC51'>					<span class="nv">keystroke</span> <span class="nb">last</span> <span class="nb">item</span> <span class="k">of</span> <span class="nv">keystokes</span> <span class="nv">using</span> <span class="nv">rest</span> <span class="k">of</span> <span class="nv">reverse</span> <span class="k">of</span> <span class="nv">keystokes</span></div><div class='line' id='LC52'>					<span class="nb">delay</span> <span class="mi">1</span></div><div class='line' id='LC53'><br/></div><div class='line' id='LC54'>					<span class="nv">click</span> <span class="nb">button</span> <span class="s2">&quot;Add&quot;</span></div><div class='line' id='LC55'>				<span class="k">end</span> <span class="k">tell</span></div><div class='line' id='LC56'>			<span class="k">end</span> <span class="k">tell</span></div><div class='line' id='LC57'>		<span class="k">end</span> <span class="k">tell</span></div><div class='line' id='LC58'>	<span class="k">end</span> <span class="k">tell</span></div><div class='line' id='LC59'><span class="k">end</span> <span class="nv">createShortcut</span></div><div class='line' id='LC60'><br/></div><div class='line' id='LC61'><span class="c">#source: <a href="http://www.macosxautomation.com/applescript/uiscripting/index.html" target="_blank">http://www.macosxautomation.com/applescript/uiscripting/index.html</a></span></div><div class='line' id='LC62'><span class="k">on</span> <span class="nv">GUIScripting_status</span><span class="p">()</span></div><div class='line' id='LC63'>	<span class="c">-- check to see if assistive devices is enabled</span></div><div class='line' id='LC64'>	<span class="k">tell</span> <span class="nb">application</span> <span class="s2">&quot;System Events&quot;</span></div><div class='line' id='LC65'>		<span class="k">set</span> <span class="nv">UI_enabled</span> <span class="k">to</span> <span class="nv">UI</span> <span class="nv">elements</span> <span class="na">enabled</span></div><div class='line' id='LC66'>	<span class="k">end</span> <span class="k">tell</span></div><div class='line' id='LC67'>	<span class="k">if</span> <span class="nv">UI_enabled</span> <span class="ow">is</span> <span class="no">false</span> <span class="k">then</span></div><div class='line' id='LC68'>		<span class="k">set</span> <span class="no">result</span> <span class="k">to</span> <span class="nb">display dialog</span> <span class="s2">&quot;This script utilizes the built-in Graphic User Interface Scripting architecture of Mac OS x which is currently disabled.&quot;</span> <span class="o">&amp;</span> <span class="no">return</span> <span class="o">&amp;</span> <span class="no">return</span> <span class="o">&amp;</span> <span class="s2">&quot;Please click &#39;OK&#39; to provide your password to activate GUI Scripting&quot;</span> <span class="nv">with</span> <span class="nv">icon</span> <span class="mi">1</span> <span class="nb">buttons</span> <span class="p">{</span><span class="s2">&quot;OK&quot;</span><span class="p">,</span> <span class="s2">&quot;Enable without password&quot;</span><span class="p">}</span> <span class="nv">default</span> <span class="nb">button</span> <span class="mi">1</span></div><div class='line' id='LC69'>		<span class="k">if</span> <span class="na">button returned</span> <span class="k">of</span> <span class="no">result</span> <span class="o">=</span> <span class="s2">&quot;Enable without password&quot;</span> <span class="k">then</span></div><div class='line' id='LC70'>			<span class="k">tell</span> <span class="nb">application</span> <span class="s2">&quot;System Preferences&quot;</span></div><div class='line' id='LC71'>				<span class="nb">activate</span></div><div class='line' id='LC72'>				<span class="k">set</span> <span class="nv">current</span> <span class="nv">pane</span> <span class="k">to</span> <span class="nv">pane</span> <span class="na">id</span> <span class="s2">&quot;com.apple.preference.universalaccess&quot;</span></div><div class='line' id='LC73'>				<span class="nb">display dialog</span> <span class="s2">&quot;Activate GUI Scripting by selecting the checkbox \&quot;Enable access for assistive devices\&quot; in the Universal Access preference pane.&quot;</span> <span class="nv">with</span> <span class="nv">icon</span> <span class="mi">1</span> <span class="nb">buttons</span> <span class="p">{</span><span class="s2">&quot;OK&quot;</span><span class="p">}</span> <span class="nv">default</span> <span class="nb">button</span> <span class="mi">1</span></div><div class='line' id='LC74'>				<span class="nb">delay</span> <span class="mi">3</span></div><div class='line' id='LC75'>			<span class="k">end</span> <span class="k">tell</span></div><div class='line' id='LC76'>		<span class="k">else</span></div><div class='line' id='LC77'>			<span class="nv">enabledGUIScripting</span><span class="p">(</span><span class="no">true</span><span class="p">)</span></div><div class='line' id='LC78'>		<span class="k">end</span> <span class="k">if</span></div><div class='line' id='LC79'>	<span class="k">end</span> <span class="k">if</span></div><div class='line' id='LC80'><span class="k">end</span> <span class="nv">GUIScripting_status</span></div><div class='line' id='LC81'><br/></div><div class='line' id='LC82'><span class="c">#source: <a href="http://www.peachpit.com/blogs/blog.aspx?uk=Using-AppleScript-to-enable-GUI-Scripting-Five-AppleScript-Tips-in-Five-Days" target="_blank">http://www.peachpit.com/blogs/blog.aspx?uk=Using-AppleScript-to-enable-GUI-Scripting-Five-AppleScript-Tips-in-Five-Days</a></span></div><div class='line' id='LC83'><span class="k">on</span> <span class="nv">enabledGUIScripting</span><span class="p">(</span><span class="nv">switch</span><span class="p">)</span></div><div class='line' id='LC84'>	<span class="k">tell</span> <span class="nb">application</span> <span class="s2">&quot;System Events&quot;</span></div><div class='line' id='LC85'>		<span class="nb">activate</span></div><div class='line' id='LC86'>		<span class="k">set</span> <span class="nv">UI</span> <span class="nv">elements</span> <span class="na">enabled</span> <span class="k">to</span> <span class="nv">switch</span></div><div class='line' id='LC87'>		<span class="no">return</span> <span class="nv">UI</span> <span class="nv">elements</span> <span class="na">enabled</span></div><div class='line' id='LC88'>	<span class="k">end</span> <span class="k">tell</span></div><div class='line' id='LC89'><span class="k">end</span> <span class="nv">enabledGUIScripting</span></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/652031/4c0d616dd3330e85f2ea9e153e40c152b55d1aa0/create_shortcuts.scpt" style="float:right;">view raw</a>
            <a href="https://gist.github.com/652031#file_create_shortcuts.scpt" style="float:right;margin-right:10px;color:#666">create_shortcuts.scpt</a>
            <a href="https://gist.github.com/652031">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>The key is &#8216;GUI scripting&#8217; &#8211; a specify way of AppleScript to simulate clicks, keystrokes etc. for *any* (native?) App. You only have to know the ids of the GUI elements which you can get with this very nice tool:<br />
  -&gt;  <a href="http://pfiddlesoft.com/uibrowser" target="_blank">http://pfiddlesoft.com/uibrowser</a></p>
<p>Good source to start your Mac Os X Automation is:<br />
  -&gt;  <a href="http://www.macosxautomation.com" target="_blank">http://www.macosxautomation.com</a></p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.rngtng.com/2010/10/29/applescript-to-create-keyboard-shortcuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SoundCloud it is&#8230;.</title>
		<link>http://www.rngtng.com/2010/09/02/soundcloud-it-is/</link>
		<comments>http://www.rngtng.com/2010/09/02/soundcloud-it-is/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 16:49:51 +0000</pubDate>
		<dc:creator>tobi</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[Ruby, Rails & Co.]]></category>
		<category><![CDATA[berlin]]></category>
		<category><![CDATA[job+]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[me]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[soundcloud]]></category>

		<guid isPermaLink="false">http://www.rngtng.com/?p=428</guid>
		<description><![CDATA[

After having enjoyed a wonderful summer with lot of travels and being in more or less 'offline' mode, I'm back 'online' and I started my new Job at soundcloud.com.
It's like Fickr but for Music - upload your tracks and share them among the community and fans.
It's kick ass! ;-) Take a look around the ...]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.wechsellook.com/postFiles/489241ba-f3d7-4310-b457-8e7e2041003d.jpg" alt="" width="551" height="252" /></p>
<p>After having enjoyed a wonderful summer with lot of travels and being in more or less &#8216;offline&#8217; mode, I&#8217;m back &#8216;online&#8217; and I started my new Job at <a href="http://www.soundcloud.com">soundcloud.com</a>.</p>
<p style="text-align: center"><em>It&#8217;s like Fickr but for Music &#8211; upload your tracks and share them among the community and fans.</em></p>
<p>It&#8217;s kick ass! <img src='http://www.rngtng.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  Take a look around the office, check this out: <a href="http://www.wechsellook.com/post/read/90" target="_blank">http://www.wechsellook.com/post/read/90</a></p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://www.rngtng.com/2010/09/02/soundcloud-it-is/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

