<?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>Hip me to the Haps &#187; Hacking</title>
	<atom:link href="http://blog.jeffverkoeyen.com/category/hacking/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.jeffverkoeyen.com</link>
	<description>Jeff Verkoeyen&#039;s Personal Blog</description>
	<lastBuildDate>Thu, 13 Oct 2011 07:45:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Nimbus Chameleon</title>
		<link>http://blog.jeffverkoeyen.com/nimbus-chameleon</link>
		<comments>http://blog.jeffverkoeyen.com/nimbus-chameleon#comments</comments>
		<pubDate>Thu, 13 Oct 2011 07:29:49 +0000</pubDate>
		<dc:creator>Jeff Verkoeyen</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Nimbus]]></category>

		<guid isPermaLink="false">http://blog.jeffverkoeyen.com/?p=178</guid>
		<description><![CDATA[Stop compiling. Start building. Chameleon for Nimbus Chameleon brings real-time CSS styling to your iOS applications. Good bye long compile times. Good bye re-installs and good bye re-navigating to the changed view controller. Say hello to seeing your changes reflected in real time. I&#8217;ll let the demo video do the talking. The Tech Chameleon was fun to build. In summary: it works by detecting changes to CSS files in your project, notifying the app of the changes, and then sending &#8230; <a href="http://blog.jeffverkoeyen.com/nimbus-chameleon">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h1><strong>Stop compiling. Start building.</strong></h1>

<h1>Chameleon for Nimbus</h1>

<p>Chameleon brings real-time CSS styling to your iOS applications. Good bye long compile times. Good bye re-installs and good bye re-navigating to the changed view controller. Say hello to seeing your changes reflected in real time.</p>

<p>I&#8217;ll let the demo video do the talking.</p>

<iframe width="780" height="585" src="http://www.youtube.com/embed/i_5LbQ8e9BU" frameborder="0" allowfullscreen></iframe>

<h1>The Tech</h1>

<p>Chameleon was fun to build. In summary: it works by detecting changes to CSS files in your project, notifying the app of the changes, and then sending the changed CSS files for the app to then re-apply to any related user interface components.</p>

<p>Chameleon itself is a node.js server that runs on your machine. The node.js server watches changes on a folder that you specify when you start up the server. For example:</p>

<pre><code>&gt; node chameleon.js --watch ../../../examples/css/CSSDemo/resources/css/
</code></pre>

<p>Once Chameleon starts, you make a request to the server&#8217;s <code>/watch</code> endpoint. This request will only complete once Chameleon notices a change on the filesystem. An example result might be something like:</p>

<pre><code>root/root.css
</code></pre>

<p>It is then the request initiator&#8217;s responsibility to request the new files from the server via <code>/root/root.css</code>. This will immediately fetch the most recent CSS file from the <code>../../../examples/css/CSSDemo/resources/css/</code> directory. In this case it would download the contents of <code>../../../examples/css/CSSDemo/resources/css/root/root.css</code>.</p>

<h3>How Nimbus uses Chameleon</h3>

<p>In the demo app from the video, the watch request is initiated by a class called NIChameleonObserver, part of the new Nimbus CSS feature. In the demo we initialize an observer and then tell it to watch skin changes from the Chameleon server.</p>

<pre><code>_chameleonObserver = [[NIChameleonObserver alloc] initWithRootFolder:@"css"];
[_chameleonObserver watchSkinChanges];
</code></pre>

<p>The observer will then post global notifications for specific stylesheets when they change. In the case of the sample app discussed in the video we had a root view controller and a corresponding root stylesheet, so the listener looks like this:</p>

<pre><code>// Fetch the global chameleon observer.
NIChameleonObserver* chameleonObserver =
  [(AppDelegate *)[UIApplication sharedApplication].delegate chameleonObserver];

// Fetch the Nimbus stylesheet object for the given file.
NIStylesheet* stylesheet = [chameleonObserver stylesheetForFilename:@"root/root.css"];

// Start watching changes for the stylesheet.
[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(chameleonSkinDidChange)
                                             name:NIChameleonSkinDidChangeNotification
                                           object:stylesheet];
</code></pre>

<p>We then simply implement the <code>chameleonSkinDidChange</code> method and respond accordingly.</p>

<pre><code>- (void)chameleonSkinDidChange {
  [_dom refresh];
}
</code></pre>

<p>_dom here is also part of the new Nimbus CSS feature. It is the beginning of what will soon be a fully-featured DOM object for applying styles to views and laying out views using the standard box model.</p>

<h1>Rationale behind building this feature</h1>

<p>I built this to scratch my own itch. From my work at Facebook and now at Google I&#8217;ve been finding that a large amount of my time has been wasted waiting for builds to compile, even when I just need to make a change as simple as &#8220;make that text blue rather than black&#8221;. This frustration is surely echoed by anyone who has had the unfortunate task of doing a clean build of Three20. Thanks to the way the Nimbus framework is set up, anyone can use Chameleon in their own project simply by adding the Nimbus Core and CSS components <em>and nothing else!</em> It really brings home the mantra of <em>&#8220;stop compiling, start building&#8221;</em>.</p>

<p>The idea was originally tossed out on the <a href="https://github.com/jverkoey/nimbus/issues/22#issuecomment-1953987">Nimbus CSS task thread</a>. I&#8217;ll have to message Rog about the fact that I&#8217;ve just gone ahead and built this! That&#8217;s what I get for waking up early on the weekend and working on this before Canadian turkey day when I should have been running errands.</p>

<h1>Supported CSS properties as of Oct 13, 2011</h1>

<p>The Nimbus CSS feature only supports a small number of properties so far but this number will only grow with time. For version 1 of the CSS feature (likely going out in Nimbus 0.9) the CSS feature will not support properties such as padding and margins.</p>

<pre><code>UIView {
  border: &lt;dimension&gt; &lt;ignored&gt; &lt;color&gt; {view.layer.borderWidth view.layer.borderColor}
  border-color: &lt;color&gt;       {view.layer.borderColor}
  border-width: &lt;dimension&gt;   {view.layer.borderWidth}
  background-color: &lt;color&gt;   {view.backgroundColor}
  border-radius: &lt;dimension&gt;  {view.layer.cornerRadius}
  opacity: &lt;number&gt;             {view.alpha}
}

UINavigationBar {
  -ios-tint-color: &lt;color&gt;     {navBar.tintColor}
}

UILabel {
  color: &lt;color&gt;                  {label.textColor}

  font: &lt;font-size&gt; &lt;font-name&gt;   {label.font}
  font-size: &lt;font-size&gt;          {label.font}
  font-name: &lt;font-name&gt;          {label.font}

  /**
   * Can't be used in conjunction with font/font-name properties. Use the italic/bold font name
   * instead.
   */
  font-style: [italic|normal]     {label.font}
  font-weight: [bold|normal]      {label.font}

  text-align: [left|right|center] {label.textAlignment}

  text-shadow: &lt;color&gt; &lt;x-offset&gt; &lt;y-offset&gt; {label.shadowColor label.shadowOffset}

  -ios-line-break-mode: [wrap|character-wrap|clip|head-truncate|tail-truncate|middle-truncate] [label.lineBreakMode]
  -ios-number-of-lines: xx             {label.numberOfLines}
  -ios-minimum-font-size: &lt;font-size&gt;  {label.minimumFontSize}
  -ios-adjusts-font-size: [true|false] {label.adjustsFontSizeToFitWidth}
  -ios-baseline-adjustment: [align-baselines|align-centers|none] {label.baselineAdjustment}
}
</code></pre>

<h1>FAQ</h1>

<h2>Why not use Interface Builder/why use CSS at all?</h2>

<p>First off, not everyone uses Interface Builder. For those who do, there are a lot of similarities between using Chameleon and Interface Builder. Where Chameleon comes out on top, though, is in making it dead easy for anyone with a background in web design to style an iOS application. All it takes is understanding how CSS works and you&#8217;re good to go. CSS also comes with the advantage of cascading styles. You can define styles for an entire class of views and therefor reuse the styles throughout your application. Make a single change to a shared css file and suddenly your entire app&#8217;s style is updated.</p>

<p>Imagine this. As you are working on the app at your desk, the designer has an iPad propped up next to their laptop on the other end of the office. As you&#8217;re making modifications based on the new mocks the designer just sent you, <em>the changes are being reflected in real time on the designer&#8217;s iPad</em>. Talk about cool.</p>

<h2>When are you releasing this?</h2>

<p>Hopefully by the end of this week. I haven&#8217;t moved up to the city yet so I&#8217;m still relatively devoid of anything to do at night down here in south bay (damn is it boring here) so I predict that I&#8217;ll have tomorrow night to focus on documenting and releasing Nimbus 0.9 complete with Chameleon and CSS.</p>

<p>If I don&#8217;t get it out tomorrow night though then it might have to wait until next week because I&#8217;m planning to go to the Treasure Island music festival this weekend. I haven&#8217;t been to live music in way too long.</p>

<p>Either way, look forward to getting your hands on this code shortly! As always it will be Apache 2.0 licensed. If you have any questions about Chameleon or Nimbus or why the hell I&#8217;d be in South Bay feel free to shoot me an email or @reply me on twitter: <a href="http://twitter.com/featherless">@featherless</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jeffverkoeyen.com/nimbus-chameleon/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Hack Faster with Secret Features</title>
		<link>http://blog.jeffverkoeyen.com/hac-faster-with-secret-features</link>
		<comments>http://blog.jeffverkoeyen.com/hac-faster-with-secret-features#comments</comments>
		<pubDate>Tue, 16 Mar 2010 04:58:51 +0000</pubDate>
		<dc:creator>Jeff Verkoeyen</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[textmate gmail hotkeys]]></category>

		<guid isPermaLink="false">http://blog.jeffverkoeyen.com/?p=99</guid>
		<description><![CDATA[I love it when I stumble upon a new feature in a piece of software that makes my life easier. I hope you do too. That&#8217;s why I&#8217;m going to take a bit to go over some of the useful things I&#8217;ve been finding lately. Gmail hotkeys on crack If you use Gmail labels (and you really should), then you&#8217;re going to love Gmail hotkeys. I&#8217;m not talking the basic stuff, like &#8216;c&#8217; to compose a new message, or &#8216;r&#8217; &#8230; <a href="http://blog.jeffverkoeyen.com/hac-faster-with-secret-features">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I love it when I stumble upon a new feature in a piece of software that makes my life easier. I hope you do too.</p>

<p>That&#8217;s why I&#8217;m going to take a bit to go over some of the useful things I&#8217;ve been finding lately.</p>

<p><span id="more-99"></span></p>

<h1>Gmail hotkeys on crack</h1>

<p>If you use Gmail labels (and you really should), then you&#8217;re going to love Gmail hotkeys. I&#8217;m not talking the basic stuff, like &#8216;c&#8217; to compose a new message, or &#8216;r&#8217; to reply to one. I&#8217;m talking full-blown keyboard control of your inbox.</p>

<p><a href="http://blog.jeffverkoeyen.com/wp-content/uploads/2010/03/Screen-shot-2010-03-16-at-12.38.10-AM.png"><img src="http://blog.jeffverkoeyen.com/wp-content/uploads/2010/03/Screen-shot-2010-03-16-at-12.38.10-AM-300x175.png" alt="" title="Gmail hotkeys" width="300" height="175" class="aligncenter size-medium wp-image-101" /></a></p>

<p>You can use the &#8216;J&#8217; and &#8216;K&#8217; keys to move down and up in the inbox, respectively. This will move that little arrow guy on the left edge of your inbox list. I&#8217;m going to call him the &#8216;caret&#8217;.</p>

<p>You can press &#8216;X&#8217; to select or deselect the caret&#8217;s current conversation. Once you&#8217;ve selected some conversations, you can press &#8216;L&#8217; to add a label. Simply type the name of the label you want to add and hit enter, and your selected emails will be updated. Now that you&#8217;ve labeled your emails, you can hit the &#8216;E&#8217; key to archive them.</p>

<h1>DTerm &#8211; Terminals everywhere</h1>

<p>The terminal is one of a hacker&#8217;s most important tools. Now you can access it everywhere with DTerm, a nifty little utility that allows you to open a terminal at the current program&#8217;s working directory. Don&#8217;t miss out on that crucially cool little feature of it; it runs from the <em>working directory</em>.</p>

<p>If you use TextMate, for example, and you have a file open, compressing that file&#8217;s directory is as trivial as pressing Command+Shift+Enter and typing your favorite compression incantation. Or maybe you quickly want to check out a man page, hit the global hotkey again and man up.</p>

<p>Highly recommended: <a href="http://www.decimus.net/dterm.php">Download DTerm for free</a></p>

<h1>Block Selection in TextMate</h1>

<p>You might have already known that you can block select text in TextMate by holding the Option key and selecting with your mouse. But this short little video could save you a lot of time in the future.</p>

<p><a href="http://www.youtube.com/watch?v=gI2hzXLbLs4">The YouTubez</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jeffverkoeyen.com/hac-faster-with-secret-features/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

