<?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>Ivan&#039;s blog</title>
	<atom:link href="http://www.hacheka.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hacheka.com</link>
	<description></description>
	<lastBuildDate>Wed, 22 Feb 2012 23:00:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.6</generator>
	<item>
		<title>My first impressions about Sencha Touch and jQuery mobile</title>
		<link>http://www.hacheka.com/my-first-impressions-about-sencha-touch-and-jquery-mobile/</link>
		<comments>http://www.hacheka.com/my-first-impressions-about-sencha-touch-and-jquery-mobile/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 23:00:13 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Mobile development]]></category>

		<guid isPermaLink="false">http://www.hacheka.com/?p=57</guid>
		<description><![CDATA[There&#8217;s a war going on outside, no man is safe from. Prodigy in &#8216;Survival of the fittest&#8217; If you are into mobile development you&#8217;ll know that there&#8217;s a war between native and html5 apps. I [&#8230;]]]></description>
				<content:encoded><![CDATA[<blockquote><p>There&#8217;s a war going on outside, no man is safe from. Prodigy in <a href="http://www.youtube.com/watch?v=i9ZykEJuFrI" target="_blank">&#8216;Survival of the fittest&#8217;</a></p></blockquote>
<p>If you are into mobile development you&#8217;ll know that there&#8217;s a war between native and html5 apps. I want to be prepared for the battle so I ended up doing a spike, choosing <a href="http://www.sencha.com/products/touch" target="_blank">Sencha Touch</a> and <a href="http://jquerymobile.com/" target="_blank">jQuery mobile</a> as weapons. </p>
<p>The two of them are UI frameworks, based on HTML5, CSS3 and javascript, so they work in any browser that supports those technologies. It&#8217;s very convenient, so you can code, test and debug in your computer browser, doing less deployments to your mobile device. You can even use these frameworks for making a website since they offer all the UI elements and AJAX support that you&#8217;ll need.</p>
<h4><span id="more-57"></span></h4>
<p>The main slogan of this kind of frameworks is that you can code your app once and deploy it in as many devices as you want. The reality is that if you need access to device features (such as camera, contacts or so) you&#8217;ll need another libraries (given by <a href="http://phonegap.com/" target="_blank">PhoneGap</a>, for instance), but you can use these frameworks to develop the code that must be cross-platform and leave the device details for later.</p>
<p>Since I only wanted to do a sneak peek of how they worked, I did only two simple examples:</p>
<h3>Sencha Touch</h3>
<p>Sencha Touch provides a bunch of Javascript classes to build your app. Everything can be developed only using those js objects, so you can forget about HTML code. Set your containers and panels, insert widgets into them and voilá! Sencha Touch will render a pretty page.</p>
<p>I did a simple sign up form that <a href="http://www.hacheka.com/webapps/sencha/index.html" target="_blank">you can play with here</a> an take a look at the Sencha code <a href="http://www.hacheka.com/webapps/sencha/js/example.js" target="_blank">here</a>.</p>
<div id="attachment_59" style="width: 310px" class="wp-caption aligncenter"><a href="http://www.hacheka.com/wp-content/uploads/2012/02/senchaform.jpg"><img src="http://www.hacheka.com/wp-content/uploads/2012/02/senchaform.jpg" alt="" title="senchaform" width="300" height="207" class="size-full wp-image-59" /></a><p class="wp-caption-text">A simple form made with Sencha Touch</p></div>
<p>As you can see in the code, in this form we have a panel form with an items array where you set the desired fields.</p>
<pre class="brush: jscript; title: ; notranslate">
var formBase = {
	scroll: 'vertical',
	url: '',
	items: [{
		xtype: 'fieldset',
		title: 'Sign up form',
		instructions: 'Please, fill in the form.',
		defaults: {
			required: true,
			labelAlign: 'left',
			labelWidth: '40%'
		},
		items: [
		{
			xtype: 'textfield',
			name : 'username',
			label: 'User name',
			useClearIcon: true,
		},
		...
</pre>
<p>After arranging and configuring the form elements via the object properties, we set the screen size (no extra work if it&#8217;s displayed on a phone), attach our previous panel to the form and finally show it.</p>
<pre class="brush: jscript; title: ; notranslate">
if (Ext.is.Phone) {
	formBase.fullscreen = true;
}
else { // Showing in a browser
	Ext.apply(formBase, {
	autoRender: true,
	floating: true,
	modal: true,
	centered: true,
	hideOnMaskTap: false,
	height: 320,
	width: 480
});

form = new Ext.form.FormPanel(formBase);
form.show();
</pre>
<p>And that&#8217;s it. All <a href="http://www.hacheka.com/webapps/sencha/js/example.js" target="_blank">this form</a> was made using only Sencha javascript classes.</p>
<h3>jQuery mobile</h3>
<p>On the other hand, jQuery mobile uses the new custom data attributes that were introduced in HTML5. It will do the hard work if you don&#8217;t want to care about CSS and javascript but leaving the door opened if you change your mind.</p>
<p>I did a even simpler page than the other one. I simply embeded my <a href="http://www.hacheka.com/craftsman-bio-generator/" target="_blank">crafstman bio generator</a> into a <a href="http://www.hacheka.com/webapps/jquerymobile/index.html" target="_blank">jquery mobile page</a>. This is how it looks.<br />
<div id="attachment_60" style="width: 310px" class="wp-caption aligncenter"><a href="http://www.hacheka.com/wp-content/uploads/2012/02/jquerymobios.jpg"><img src="http://www.hacheka.com/wp-content/uploads/2012/02/jquerymobios.jpg" alt="" title="jquerymobios" width="300" height="286" class="size-full wp-image-60" /></a><p class="wp-caption-text">Craftsman bio generator with jQuery mobile</p></div></p>
<p>The jQuery mobile part is really simple. The body code is:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;body onload=&quot;onBodyLoad()&quot;&gt;
	&lt;div data-role=&quot;page&quot; data-fullscreen=&quot;true&quot;&gt;
		&lt;div data-role=&quot;header&quot; &gt;
			&lt;h1&gt;Craftsman bio generator&lt;/h1&gt;
		&lt;/div&gt;
		&lt;div data-role=&quot;content&quot;&gt;
			&lt;p id=&quot;bioText&quot;&gt;How you doing?&lt;/p&gt;
			&lt;a id=&quot;theButton&quot; href=&quot;#&quot; data-role=&quot;button&quot;&gt;Generate bio!&lt;/a&gt;
		&lt;/div&gt;
		&lt;div data-role=&quot;footer&quot; &gt;
			&lt;h4&gt;hacheka.com&lt;/h4&gt;
		&lt;/div&gt;	
	&lt;/div&gt;
&lt;/body&gt;
</pre>
<p>The page template consists in one main div with the attribute data-role=&#8221;page&#8221; and three others divs (header, content and footer). You can play <a href="http://www.hacheka.com/webapps/jquerymobile/index.html" target="_blank">with this page</a> here and have a look to the source code.</p>
<p>jQuery mobile will carry the weight and transform that simple code into a good looking web page.</p>
<h3>My premature conclusions</h3>
<p>These pages were really simple but my objective was only to make a first approach to webapps development. The two frameworks are very powerful and come with a bunch of UI widgets and other web stuff. I encourage you to spend a few hours doing experiments with them.</p>
<p>I personally prefer the native way but if you already know javascript you&#8217;ll save lots of hours doing real work instead of learning new languages. I&#8217;d rather go with jQuery mobile as a personal taste and I&#8217;ll write a post about how to use it for real cross-platform development, testing a simple webapp (probably the omnipresent bio generator) in iPhone and Android. I swear.</p>
<p>Bye!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hacheka.com/my-first-impressions-about-sencha-touch-and-jquery-mobile/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A custom view in iOS</title>
		<link>http://www.hacheka.com/a-custom-view-in-ios/</link>
		<comments>http://www.hacheka.com/a-custom-view-in-ios/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 23:19:19 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://www.hacheka.com/?p=51</guid>
		<description><![CDATA[iOS SDK gives you plenty of UI elements. Only armed with them you can develop pretty apps but there&#8217;ll be a time when you need to make awesome ones! For that, you&#8217;ll have to make [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>iOS SDK gives you plenty of UI elements. Only armed with them you can develop pretty apps but there&#8217;ll be a time when you need to make awesome ones! For that, you&#8217;ll have to make your own UI widgets. To understand how to do it, I designed an app that shows charts with the accelerometer values.</p>
<h4><span id="more-51"></span></h4>
<p><a href="http://www.hacheka.com/wp-content/uploads/2012/02/transient_app.jpg"><img src="http://www.hacheka.com/wp-content/uploads/2012/02/transient_app-209x300.jpg" alt="" title="transient_app" width="209" height="300" class="aligncenter size-medium wp-image-54" srcset="http://www.hacheka.com/wp-content/uploads/2012/02/transient_app-209x300.jpg 209w, http://www.hacheka.com/wp-content/uploads/2012/02/transient_app-560x803.jpg 560w, http://www.hacheka.com/wp-content/uploads/2012/02/transient_app.jpg 640w" sizes="(max-width: 209px) 100vw, 209px" /></a></p>
<h3>Three simple steps for making a custom view</h3>
<p>The first place to look for is, of course, the iOS developer library. In the &#8216;<a href="https://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/CreatingViews/CreatingViews.html#//apple_ref/doc/uid/TP40009503-CH5-SW23" target="_blank">View programming guide</a>&#8216; you can find a checklist for implementing custom views (&#8216;Defining a custom view&#8217; section).</p>
<p>My view gets the X,Y and Z values from the phone accelerometer and print them in a timeline chart. There are several items in that checklist but I don&#8217;t do any autoresizing and don&#8217;t have subviews so I skipped them.</p>
<h4>Initialization methods</h4>
<p>You&#8217;ll need to override the initWithFrame: and initWithCoder: methods. The former for creating the view programatically and the latter for using it in the interface builder.</p>
<p>Don&#8217;t be afraid. I wrote only the minimum code and it works flawlessly. The InitialSteps: method only set initial values and call the CreateGestureRecognizers: method (more on this later).</p>
<pre class="brush: objc; title: ; notranslate">
- (id)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self)
        [self InitialSteps];

    return self;
}
</pre>
<h4>Drawing code</h4>
<p>All the magic takes place in the drawRect: method. You have to override it and do your custom drawing in there. In my case, I first draw the X-Y axis. Then I transform the accelerometer values into screen coordinates and draw the dimensions lines if its button is lit. I won&#8217;t show you the code because it was made in &#8216;cowboy mode doing spaguetti code&#8217; but trust me, drawing your custom view is quite easy. As the Apple guide says, you&#8217;re encouraged to write the minimum lines of code here and bound to do drawing operations. Any other task is not recommended.</p>
<p>Take this recommendation seriously and try to optimize the drawRect: method as much as possible. I did no clipping (draw only the values that fall within the view) and calculated the coordinates transformation inside the function. As a result, when there were lots of accelerometer values the screen refreshing slowed down. So be a nice guy and keep your draw method clean.</p>
<h4>Gesture recognizers</h4>
<p>If your custom view needs user interaction, you&#8217;ll have to attach the proper gesture methods. You can create your own ones or, more easily, use the ones that come in iOS. In my example, I needed to handle pinch (for zooming) and pan (for moving along the timeline). It&#8217;s quite easy to include them.</p>
<pre class="brush: objc; title: ; notranslate">
- (void)CreateGestureRecognizers
{
  UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizer alloc]
                                      initWithTarget:self
                                      action:@selector(handlePinch:)];
  [self addGestureRecognizer:pinch];
  [pinch release];
    
  UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc]
                                          initWithTarget:self
                                          action:@selector(handlePanGesture:)];
  [self addGestureRecognizer:panGesture];
  [panGesture release];
}
</pre>
<p>Assign a method for each recognizer with the right signature. For example, the pinch method signature is <code>(void)handlePinch:(UIGestureRecognizer*)sender</code>. The sender gives you the current scale of the view, so you can do the proper calculations for zooming your content.</p>
<p>And that&#8217;s it! Quite simple, isn`t it? See the view in action!<br />
<iframe width="560" height="420" src="http://www.youtube.com/embed/_k53ItgSD4g?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hacheka.com/a-custom-view-in-ios/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Music for Quares</title>
		<link>http://www.hacheka.com/music-for-quares/</link>
		<comments>http://www.hacheka.com/music-for-quares/#respond</comments>
		<pubDate>Mon, 30 Jan 2012 15:00:39 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hacheka.com/?p=48</guid>
		<description><![CDATA[Quares is an addictive puzzle game where you have to fight against the clock, trying to find the biggest squares with its four corners of the same colour. Once you begin to play, you can&#8217;t [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.doubleequal.com/quares/" target="_blank">Quares</a> is an addictive puzzle game where you have to fight against the clock, trying to find the biggest squares with its four corners of the same colour. Once you begin to play, you can&#8217;t stop. It&#8217;s available for <a href="http://itunes.apple.com/us/app/quares/id455728856?mt=8" target="_blank">iOS</a> and <a href="https://market.android.com/details?id=com.doublequal.quares" target="_blank">Android</a> platforms, developed by my friends at <a href="https://twitter.com/#!/doubleequal" target="_blank">DoubleEqual</a> (<a href="https://twitter.com/#!/abeljus" target="_blank">Abel</a> and <a href="https://twitter.com/#!/nilart" target="_blank">Guillermo</a>).</p>
<h4><span id="more-48"></span></h4>
<p>They needed a little help with the music so <a href="http://www.grossomodo.org/" target="_blank">Grossomodo</a> (my colleague Agus and me) composed some fx and three tunes. Our idea was to make catchy loops to inmerse you in the game frenzy. The electronic one that you can hear in the video below is a good example. I think we made it.</p>
<p>Even if you don&#8217;t like the music (do you have such a bad taste?) try the game. I dare you to make a Quares, the square that fills all the screen! And it&#8217;s free!</p>
<p><a class="button small blue" href="http://itunes.apple.com/us/app/quares/id455728856?mt=8" target="_blank">Quares App Store</a><a class="button small green" href="https://market.android.com/details?id=com.doublequal.quares" target="_blank">Quares for Android</a></p>
<p>By the way, if you need some music for your game drop me a line.</p>
<p><iframe width="420" height="315" src="http://www.youtube.com/embed/K2FqZcb7Q2w" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hacheka.com/music-for-quares/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Craftsman bio generator. A TDD practice.</title>
		<link>http://www.hacheka.com/craftman-bio-generator-a-tdd-practice/</link>
		<comments>http://www.hacheka.com/craftman-bio-generator-a-tdd-practice/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 11:44:09 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Jasmine]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://www.hacheka.com/?p=43</guid>
		<description><![CDATA[Last week a friend of mine (one of the developers of Quares) told me an idea about an iPhone game. It was a rap battle game and he wanted my advise, due to my expertise [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Last week a friend of mine (one of the developers of <a href="http://www.doubleequal.com/quares/" target="_blank">Quares</a>) told me an idea about an iPhone game. It was a rap battle game and he wanted my advise, due to my expertise in emceeing <img src="https://s.w.org/images/core/emoji/11/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> His first approach was to have a kazillion pre-recorded raps and then assign them weights, points, whatever&#8230; Soon we saw that it&#8217;d be better to generate rhymes but it seemed a tough job.</p>
<p>Challenge accepted!!</p>
<h4><span id="more-43"></span></h4>
<h4>Choosing the TDD way</h4>
<p>I knew how to develop this in a traditional way. A phrase generator can be build using <a href="http://en.wikipedia.org/wiki/Context-free_grammar" target="_blank">context-free grammar</a> but as I want to learn how to apply TDD I chose to try that way. I also want to master javascript as a new language this year and TDD practice is one of the best methods I know for that purpose.</p>
<p>What I found more difficult was to <strong>ask the right questions</strong>. It&#8217;s kind of funny to ask something when you know the answer but the objective was to build the data structure test by test. I based them on the existence of terminals (final text) and non-terminals (tokens that can be substituted for both terminals and non-terminals). From that point, it was easier to start.</p>
<p>You can find the project in <a href="https://github.com/hacheka/GrammarEngine" target="_blank">GitHub</a>. It&#8217;s written in Javascript and it uses <a href="http://pivotal.github.com/jasmine/" target="_blank">Jasmine </a>as a test framework.</p>
<h4>My self exam</h4>
<ul>
<li> As I said before, the key point is to <strong>ask good questions</strong>. There are many ways to skin a cat and bad tests can lead you in a wrong direction. I need to study other&#8217;s people katas to improve this skill.</li>
<li><strong>Not enough refactoring</strong>. I think that I need to be more aggresive in refactoring. Sometimes I don&#8217;t feel like a refactor is needed right now, leaving a likely broken window. The same thought about katas applies here.</li>
<li>Not sure when it&#8217;s better to <strong>inject dependencies / use composition</strong>. In the end it works as this is a simple example but I have to keep an eye on this.</li>
<li>It&#8217;s difficult to create a <strong>good grammar</strong>. This is not a TDD or development issue but I assure you it&#8217;s quite hard.</li>
</ul>
<h4>Craftsman bio generator</h4>
<p>After having all my test in a healthy green color and with the ability to substitute non-terminals I decided to have more fun. I&#8217;ve created a craftsman bio generator, in case you don&#8217;t know what to write in your twitter account.</p>
<p>Here are some examples:</p>
<ul>
<li>Co-author of &#8216;The best practices for Haskell&#8217; and &#8216;Clean Clojure&#8217; (contributor). Scrum enthusiast, Ruby on Rails expert, father.</li>
<li>Working at NextLearning, Haskell expert, husband. Likes reading. Writing Ruby on Rails webs for CompuGlobalHyperMegaNet also.</li>
<li>I write code for NextCoding.com. Prize-Winning author of &#8216;Developing XP Haskell software&#8217; and &#8216;Clean RoR&#8217;.</li>
</ul>
<p><a class="button small orange" href="http://www.hacheka.com/craftsman-bio-generator/"  target="_blank">Craftsman bio generator</a></p>
<p>I&#8217;ve uploaded the generator to my <a href="https://github.com/hacheka/Craftsman-bio-generator" target="_blank">GitHub</a>. All the magic is in the grammar file (<a href="https://github.com/hacheka/Craftsman-bio-generator/blob/master/src/bioGrammar.js" target="_blank">bioGrammar.js</a>). You can study how the generation it&#8217;s done and if you use it for building your own generation let me know!</p>
<h4>Improvements</h4>
<ul>
<li><strong>More test cases</strong>. I guess there aren&#8217;t enough tests. You need one that traverses all the grammar to find errors in that structure prior to begin execution. I did tests only for the code but finding issues in the data is a plus.</li>
<li><strong>Number / gender concordance</strong>. This is planned for the next iteration. Remember that the aim is to have a rhyme generator, but before, if I want to build sentences that make sense I have to add more complexity to the substitution process, taking care of the number and gender of the subjects.</li>
</ul>
<p>Have fun!</p>
<p>&nbsp;</p>
<address>Featured image <a href="http://www.lancashirejoiners.com/html/welcome.html" target="_blank">Argyle Street Joinery</a> (modified)</address>
]]></content:encoded>
			<wfw:commentRss>http://www.hacheka.com/craftman-bio-generator-a-tdd-practice/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Newbie guide for using GitHub in Mac OSX</title>
		<link>http://www.hacheka.com/newbie-guide-for-using-github-in-mac-osx/</link>
		<comments>http://www.hacheka.com/newbie-guide-for-using-github-in-mac-osx/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 17:27:41 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://www.hacheka.com/?p=17</guid>
		<description><![CDATA[First of all, note that I&#8217;ve said &#8216;newbie guide&#8217; and not &#8216;guide for newbies&#8217; ;). I&#8217;ve been using Subversion for years but I knew nothing about Git. As GitHub is quite popular these days and [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>First of all, note that I&#8217;ve said &#8216;newbie guide&#8217; and not &#8216;guide for newbies&#8217; ;). I&#8217;ve been using Subversion for years but I knew nothing about Git. As GitHub is quite popular these days and I want to publish some code in this blog, I&#8217;ve written this little guide for helping me to remember how to get it working. I hope you&#8217;ll find this useful too.</p>
<h4><span id="more-17"></span></h4>
<h3>Set up Git</h3>
<p>First, you need <a href="https://github.com/signup/free" target="_blank">a GitHub account</a>. If you&#8217;ve been in a coma, just woken up and you know nothing about this code hosting service, I&#8217;ll tell you that is free as long as you use it for open source projects. The repository will be public. In case you want your repositories to be private, you can sign up for a paid account.</p>
<p>Once you have your account, you&#8217;ll need to get Git correctly installed. Use the GitHub guide for Mac OSX. There are a few simple steps and you&#8217;ll have to do it only once.</p>
<p><a href="http://help.github.com/mac-set-up-git/" target="_blank">Set up Git in OSX &#8211; GitHub help</a></p>
<h3>Download GitHub for Mac</h3>
<p>You can control your git repositories through the command line but I wanted to make the transition smooth, so I downloaded the GitHub client for Mac. I&#8217;ll use the client for the rest of the guide so I recommend you to install it.</p>
<p><a href="http://mac.github.com/" target="_blank">Download GitHub for Mac</a></p>
<p>Once you have it installed, you&#8217;ll see nothing, assuming that you&#8217;ve just opened your account and you don&#8217;t have any repository yet.</p>
<div id="attachment_22" style="width: 570px" class="wp-caption alignnone"><a href="http://www.hacheka.com/wp-content/uploads/2012/01/github_empty.jpg"><img class="size-full wp-image-22" title="github_empty" src="http://www.hacheka.com/wp-content/uploads/2012/01/github_empty.jpg" alt="" width="560" height="407" srcset="http://www.hacheka.com/wp-content/uploads/2012/01/github_empty.jpg 560w, http://www.hacheka.com/wp-content/uploads/2012/01/github_empty-300x218.jpg 300w" sizes="(max-width: 560px) 100vw, 560px" /></a><p class="wp-caption-text">GitHub for Mac</p></div>
<p>Now, we&#8217;ll create a repository in GitHub and connect it to a folder in your computer.</p>
<h3>Create a repository</h3>
<p>To create a new repo, go to your account page (click your name in the upper bar) and push the &#8216;New repository&#8217; button.</p>
<div id="attachment_23" style="width: 556px" class="wp-caption alignnone"><a href="http://www.hacheka.com/wp-content/uploads/2012/01/new_repo.jpg"><img class="size-full wp-image-23 " style="border-image: initial; border-width: 1px; border-color: black; border-style: solid;" title="new_repo" src="http://www.hacheka.com/wp-content/uploads/2012/01/new_repo.jpg" alt="" width="546" height="228" srcset="http://www.hacheka.com/wp-content/uploads/2012/01/new_repo.jpg 546w, http://www.hacheka.com/wp-content/uploads/2012/01/new_repo-300x125.jpg 300w" sizes="(max-width: 546px) 100vw, 546px" /></a><p class="wp-caption-text">Create new repository</p></div>
<p>In the next page, fill in the form with the desired name and description.</p>
<p>&nbsp;</p>
<div id="attachment_25" style="width: 556px" class="wp-caption alignnone"><a href="http://www.hacheka.com/wp-content/uploads/2012/01/new_repo_desc1.jpg"><img class=" wp-image-25    " style="border-image: initial; border-width: 1px; border-color: black; border-style: solid;" title="new_repo_desc" src="http://www.hacheka.com/wp-content/uploads/2012/01/new_repo_desc1.jpg" alt="" width="546" height="372" srcset="http://www.hacheka.com/wp-content/uploads/2012/01/new_repo_desc1.jpg 558w, http://www.hacheka.com/wp-content/uploads/2012/01/new_repo_desc1-300x204.jpg 300w" sizes="(max-width: 546px) 100vw, 546px" /></a><p class="wp-caption-text">Enter the repository name and description</p></div>
<p>After that, you&#8217;ll see a page with several instructions. Skip the &#8216;Global setup&#8217; section since you executed that two commands already while setting up Git in the first place. Go on with the &#8216;Next steps&#8217; section. Open a terminal and make the directory where you want to place the local repo. These commands will have different parameters depending on your selected name and account.</p>
<div id="attachment_26" style="width: 562px" class="wp-caption alignnone"><a href="http://www.hacheka.com/wp-content/uploads/2012/01/next_steps.jpg"><img class="size-full wp-image-26" title="next_steps" src="http://www.hacheka.com/wp-content/uploads/2012/01/next_steps.jpg" alt="" width="552" height="170" srcset="http://www.hacheka.com/wp-content/uploads/2012/01/next_steps.jpg 552w, http://www.hacheka.com/wp-content/uploads/2012/01/next_steps-300x92.jpg 300w" sizes="(max-width: 552px) 100vw, 552px" /></a><p class="wp-caption-text">Next steps for creating repo</p></div>
<p>After doing this, you&#8217;ll see the new repo with the empty README file in your GitHub account.</p>
<div id="attachment_27" style="width: 556px" class="wp-caption alignnone"><a href="http://www.hacheka.com/wp-content/uploads/2012/01/first_commit.jpg"><img class=" wp-image-27  " style="border-image: initial; border-width: 1px; border-color: black; border-style: solid;" title="first_commit" src="http://www.hacheka.com/wp-content/uploads/2012/01/first_commit.jpg" alt="" width="546" height="73" srcset="http://www.hacheka.com/wp-content/uploads/2012/01/first_commit.jpg 560w, http://www.hacheka.com/wp-content/uploads/2012/01/first_commit-300x40.jpg 300w" sizes="(max-width: 546px) 100vw, 546px" /></a><p class="wp-caption-text">First commit done!</p></div>
<p>Now, we&#8217;ll take care of our local repo with the GitHub app. Open GitHub and go to &#8216;GitHub &gt; Preferences&#8217;.</p>
<div id="attachment_28" style="width: 350px" class="wp-caption alignnone"><a href="http://www.hacheka.com/wp-content/uploads/2012/01/preferences.jpg"><img class="size-full wp-image-28 " style="border-image: initial; border-width: 1px; border-color: black; border-style: solid;" title="preferences" src="http://www.hacheka.com/wp-content/uploads/2012/01/preferences.jpg" alt="" width="340" height="114" srcset="http://www.hacheka.com/wp-content/uploads/2012/01/preferences.jpg 340w, http://www.hacheka.com/wp-content/uploads/2012/01/preferences-300x100.jpg 300w" sizes="(max-width: 340px) 100vw, 340px" /></a><p class="wp-caption-text">Open GitHub app &gt; Preferences</p></div>
<p>Select &#8216;Repositories&#8217; page and then click on &#8216;Scan For Repositories&#8217;.</p>
<div id="attachment_29" style="width: 500px" class="wp-caption alignnone"><a href="http://www.hacheka.com/wp-content/uploads/2012/01/scan_for.jpg"><img class="size-full wp-image-29 " style="border-image: initial; border-width: 1px; border-color: black; border-style: solid;" title="scan_for" src="http://www.hacheka.com/wp-content/uploads/2012/01/scan_for.jpg" alt="" width="490" height="356" srcset="http://www.hacheka.com/wp-content/uploads/2012/01/scan_for.jpg 490w, http://www.hacheka.com/wp-content/uploads/2012/01/scan_for-300x217.jpg 300w" sizes="(max-width: 490px) 100vw, 490px" /></a><p class="wp-caption-text">Scan for repositories</p></div>
<p>Select the folder where you created the repository. It&#8217;ll be showed in a list. If is not selected, select it.</p>
<div id="attachment_30" style="width: 366px" class="wp-caption alignnone"><a href="http://www.hacheka.com/wp-content/uploads/2012/01/select_repo.jpg"><img class="size-full wp-image-30 " style="border-image: initial; border-width: 1px; border-color: black; border-style: solid;" title="select_repo" src="http://www.hacheka.com/wp-content/uploads/2012/01/select_repo.jpg" alt="" width="356" height="87" srcset="http://www.hacheka.com/wp-content/uploads/2012/01/select_repo.jpg 356w, http://www.hacheka.com/wp-content/uploads/2012/01/select_repo-300x73.jpg 300w" sizes="(max-width: 356px) 100vw, 356px" /></a><p class="wp-caption-text">Select local repository</p></div>
<p>From now on, you&#8217;ll have this local repository available in the main window of the app.</p>
<div id="attachment_32" style="width: 556px" class="wp-caption alignnone"><a href="http://www.hacheka.com/wp-content/uploads/2012/01/local_repo1.jpg"><img class=" wp-image-32 " style="border-image: initial; border-width: 1px; border-color: black; border-style: solid;" title="local_repo" src="http://www.hacheka.com/wp-content/uploads/2012/01/local_repo1.jpg" alt="" width="546" height="140" srcset="http://www.hacheka.com/wp-content/uploads/2012/01/local_repo1.jpg 558w, http://www.hacheka.com/wp-content/uploads/2012/01/local_repo1-300x76.jpg 300w" sizes="(max-width: 546px) 100vw, 546px" /></a><p class="wp-caption-text">Your local repository is now available through GitHub app.</p></div>
<p>Click on the arrow ont the right side of the repo box and you&#8217;ll access to the repo page, where you can watch its story, changes, branches and settings. Modify the README file in an editor and you&#8217;ll see how &#8216;Changes&#8217; page reflects that. I&#8217;ve added a couple of lines to the file, as you can see in the right zone of the page.</p>
<div id="attachment_33" style="width: 556px" class="wp-caption alignnone"><a href="http://www.hacheka.com/wp-content/uploads/2012/01/changes.jpg"><img class=" wp-image-33  " style="border-image: initial; border-width: 1px; border-color: black; border-style: solid;" title="changes" src="http://www.hacheka.com/wp-content/uploads/2012/01/changes.jpg" alt="" width="546" height="201" srcset="http://www.hacheka.com/wp-content/uploads/2012/01/changes.jpg 558w, http://www.hacheka.com/wp-content/uploads/2012/01/changes-300x110.jpg 300w" sizes="(max-width: 546px) 100vw, 546px" /></a><p class="wp-caption-text">Changes page</p></div>
<p>Now, as far as I&#8217;ve understood, if you want your changes to be reflected in the repository there are two steps to do. First, when you commit your code, your local repo will be updated. This is done using the &#8216;Commit Changes&#8217; button. Next, if you want your changes to be published in the remote repo, i.e. the GitHub repo, you can sync that commit or simply push it. Sync will bring in changes from the remote and push any pending commits. This is the option that GitHub recommends in its help.</p>
<p>You can see your unsynced commits in this same page. When you&#8217;re ready, push the &#8216;Sync&#8217; button and your code will be updated in the remote repo.</p>
<div id="attachment_34" style="width: 470px" class="wp-caption alignnone"><a href="http://www.hacheka.com/wp-content/uploads/2012/01/syncing.jpg"><img class="size-full wp-image-34 " style="border-image: initial; border-width: 1px; border-color: black; border-style: solid;" title="syncing" src="http://www.hacheka.com/wp-content/uploads/2012/01/syncing.jpg" alt="" width="460" height="149" srcset="http://www.hacheka.com/wp-content/uploads/2012/01/syncing.jpg 460w, http://www.hacheka.com/wp-content/uploads/2012/01/syncing-300x97.jpg 300w" sizes="(max-width: 460px) 100vw, 460px" /></a><p class="wp-caption-text">Syncing repo</p></div>
<p>That&#8217;s all, folks! Now you have your project in GitHub, synchronized with your local folder. You can begin to add your source code as any new file will appear in the &#8216;Changes&#8217; page.</p>
<h3>Using GitHub for your Xcode projects</h3>
<p>If you plan to use your repo to host a Xcode project, the first thing recommended is to create a .gitignore file. It&#8217;ll avoid to push unneccesary files. After searching for the right ignored files in the internet, I found the one in <a href="http://www.codedifferent.com/2011/05/01/coding-gitignore-for-xcode-4/" target="_blank">CodeDifferent</a> the most complete one.  Kudos to Christian for <a href="http://www.codedifferent.com/2011/05/01/coding-gitignore-for-xcode-4/" target="_blank">writing this file.</a> I reproduce it <a href="https://gist.github.com/1616357" target="_blank">here</a>.<br />
<script type="text/javascript" src="https://gist.github.com/1616357.js">// <![CDATA[


// ]]&gt;</script></p>
<p>You can write the .gitignore file directly in the GitHub app. Go to the repo settings page, paste the text into the &#8216;Ignored files&#8217; box and save changes.</p>
<div id="attachment_35" style="width: 556px" class="wp-caption alignnone"><a href="http://www.hacheka.com/wp-content/uploads/2012/01/gitignore.jpg"><img class=" wp-image-35  " style="border-image: initial; border-width: 1px; border-color: black; border-style: solid;" title="gitignore" src="http://www.hacheka.com/wp-content/uploads/2012/01/gitignore.jpg" alt="" width="546" height="210" srcset="http://www.hacheka.com/wp-content/uploads/2012/01/gitignore.jpg 558w, http://www.hacheka.com/wp-content/uploads/2012/01/gitignore-300x115.jpg 300w" sizes="(max-width: 546px) 100vw, 546px" /></a><p class="wp-caption-text">Ignored files</p></div>
<p>Now you&#8217;re ready to create a new Xcode project. Proceed as always, but make sure that you create the project in the folder where you have set the local git repository and don&#8217;t check the &#8216;Create local git repository&#8217; option.</p>
<p>As you add files to your project, they&#8217;ll appear in the &#8216;Changes&#8217; page.</p>
<h3>But wait&#8230; why don&#8217;t you use the local git repo option in Xcode?</h3>
<p>That was my first option. I thought it&#8217;d be a walk in the park but I failed several times to get my local git repo made by Xcode correctly synched with GitHub. I didn&#8217;t find an easy way in the internet so I did the steps in this guide instead. When I&#8217;ll get used to Git I&#8217;ll try again and post another guide to use the Xcode way. If you have the solution, feel free to post it in the comments section.</p>
<div id="attachment_36" style="width: 556px" class="wp-caption alignnone"><a href="http://www.hacheka.com/wp-content/uploads/2012/01/xcode_git.jpg"><img class=" wp-image-36 " style="border-image: initial; border-width: 1px; border-color: black; border-style: solid;" title="xcode_git" src="http://www.hacheka.com/wp-content/uploads/2012/01/xcode_git.jpg" alt="" width="546" height="123" srcset="http://www.hacheka.com/wp-content/uploads/2012/01/xcode_git.jpg 558w, http://www.hacheka.com/wp-content/uploads/2012/01/xcode_git-300x67.jpg 300w" sizes="(max-width: 546px) 100vw, 546px" /></a><p class="wp-caption-text">Local Git option in Xcode</p></div>
<p>Have a nice commit!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hacheka.com/newbie-guide-for-using-github-in-mac-osx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://www.hacheka.com/hello-world-2/</link>
		<pubDate>Mon, 09 Jan 2012 17:02:52 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.hacheka.com/?p=13</guid>
		<description><![CDATA[Welcome to my blog! Who am I? My name is Ivan Malagon. I&#8217;m spanish, born in Zaragoza but living in Madrid. Software engineer by day, Hip-Hop musician at night. Well, not everynight, but I hear [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Welcome to my blog!</p>
<h3>Who am I?</h3>
<p>My name is <strong>Ivan Malagon</strong>. I&#8217;m spanish, born in <a href="http://g.co/maps/zhq5p" target="_blank">Zaragoza </a>but living in <a href="http://g.co/maps/255u4" target="_blank">Madrid</a>. Software engineer by day, Hip-Hop musician at night. Well, not everynight, but I hear drums in my head all the time.</p>
<h4><span id="more-13"></span>What am I aiming for with this blog?</h4>
<p>I always find myself thinking about learning this, improving that, making apps&#8230; but in the end I do nothing at all. That time is over! As part of my new years&#8217; resolutions I&#8217;ve decided to write this self-development journal, a way of forcing myself to make something in my spare time and show it to the world. I need witnesses to embarrass me if I make no progress.</p>
<p>The topics I want to cover here are mainly two: software development and music theory-to-practice.</p>
<p>Talking about software, I&#8217;m now certainly obsessed with XP good practices, mainly <strong>TDD</strong> and <strong>refactoring</strong>. My idea is to assign myself some light homework, resolve it and post the solution (or, at least, the main hits of the solution path).</p>
<p>I will focus on mobile development, both <strong>native iOS</strong> and <strong>HTML5/CSS3/Js</strong> combo. I have some experience in the former and little-to-none in the latter but I don&#8217;t want to miss the cross-platform train and HTML5/Js seems to be the champion in that area.</p>
<p>Talking about music, I&#8217;m the half of Grossomodo, a Hip-Hop group of emcees and producers. We&#8217;ve published a couple of records and produced lots of tracks for other people. You can see our work in <a href="http://www.grossomodo.org" target="_blank">www.grossomodo.org</a> and in our <a href="http://versosperfectos.com/autores/-/grossomodo/colaboraciones/" target="_blank">versosperfectos profile</a>. My nickname in the group is Hacheka, hence the name of this blog domain. Right now, I&#8217;m a bit retired of the public life but I continue making beats and learning music. I&#8217;d like to write the lessons of my piano&#8217;s teacher in this blog. His lessons are a bit messy and I need to write them down.</p>
<p>And last but not least, I&#8217;ll try my best to post always in english, although I find it a hell of a task. As someone with a technician background I read tons of articles in english but I only write from time to time so I need to improve that skill. If you see me throwing in the towel and writing in spanish, you can punch me (but gently, please).</p>
<p>So this is my public commitmment. <strong>Let&#8217;s go!</strong></p>
<address>Featured image: <a href="http://hdw.eweb4.com/out/124379.html" target="_blank">Hello world wallpaper</a></address>
]]></content:encoded>
			</item>
	</channel>
</rss>
