http://yannesposito.com/ Yogsototh's last blogs entries 2010-08-23T13:05:13Z Yann Esposito http://yannesposito.com tag:yannesposito.com,2010-08-23:/Scratch/en/blog/2010-08-23-Now-heberged-on-heroku/ Now heberged on heroku 2010-08-23T13:05:13Z 2010-08-23T13:05:13Z <h1 class="first" id="now-on-herokuhttpherokucom">Now on <a href="http://heroku.com">Heroku</a></h1> <p>I now changed my hosting to <a href="http://heroku.com">Heroku</a>. I believe it will be far more reliable.</p> <p>But as you should know my website is completely static. I use <a href="http://nanoc.stoneship.org/">nanoc</a> to generate it. But here is the conf to make it work on heroku.</p> <p>The root of my files is <code>/output</code>. You only need to create a <code>config.ru</code> file:</p> <div class="code"><div class="file"><a href="/Scratch/en/blog/2010-08-23-Now-heberged-on-heroku/code/config.ru"> &#x27A5; config.ru </a></div><div class="withfile"> <pre class="twilight"> <span class="Keyword">require</span> <span class="String"><span class="String">'</span>rubygems</span></pre></div></div> tag:yannesposito.com,2010-08-11:/Scratch/en/blog/2010-07-09-Indecidabilities/ Undecidabilities (part 1) 2010-08-11T08:04:31Z 2010-08-11T08:04:31Z <div class="intro"> <p><span class="sc"><abbr title="Too long; don't read">tl;dr</abbr>: </span> I pretend to create a world to give examples of different meanings behind the word <em>undecidability</em>:</p> <ul> <li>Undecidability due to measure errors, </li> <li>Big errors resulting from small initial measure error,</li> <li>Fractal undecidability&nbsp;;</li> <li>Logic Undecidability.</li> </ul> </div> </div> <div class="corps"> <h1 class="first" id="the-undecidabilities">The Undecidabilities</h1> <div class="intro"> <p>If a demiurge made our world, he certainly had a great sense of humor. After this read, you should be convinced. I&rsquo;ll pretend to be him. I&rsquo;ll create a simplified world. A world that obey to simple mathematical rules. And I&rsquo;ll ...</p></div> tag:yannesposito.com,2010-07-31:/Scratch/en/blog/2010-07-31-New-style-after-holidays/ New style after holidays 2010-07-31T21:59:10Z 2010-07-31T21:59:10Z <p>Before my holidays many visitors tell me my website was too long to scroll. This is why I completely changed my website design. Now all should scroll smoothly on all platforms. I was inspired by Readability and iBooks<small>&copy;</small> (the iPhone<small>&copy;</small> application).</p> <p>Tell me what you think of this new design.</p> tag:yannesposito.com,2010-07-07:/Scratch/en/blog/2010-07-07-CSS-rendering-problems-by-navigator/ Do not use CSS gradient with Chrome 2010-07-07T13:43:43Z 2010-07-07T13:43:43Z <p>Some <a href="http://reddit.com">Reddit</a> users reported my website was really long to load and to scroll. They thinks it was because of the &lsquo;1px shadow&rsquo; I apply on all the text. I was a bit surprised, because I make some test into a really <em>slow</em> virtual machine. And all have always worked fine. In fact, what slow down so much are by order of importance:</p> <ol> <li>Radial gradient on Chrome (not in Safari on Mac)</li> <li>Box shadows on Firefox and Chrome</li> </ol> <h2 id="gradient">Gradient</h2> <p>On Safari on Mac there is absolutely no rendering time problem. But when I use Chrome under Linux it is almost unusable.</p> <p>Safari and Chrome use webkit, when you access my website with javascript enabled, an additionnal browser specific CSS is loaded....</p> tag:yannesposito.com,2010-07-05:/Scratch/en/blog/2010-07-05-Cappuccino-and-Web-applications/ Cappuccino vs jQuery 2010-07-05T11:49:04Z 2010-07-05T11:49:04Z <div class="intro"> <p><abbr class="sc" title="Too long; don't read">tl;dr</abbr>:</p> <ul> <li>Tried to make <a href="http://yannesposito.com/Softwares/YPassword.html">YPassword</a> in jQuery and with Cappuccino.</li> <li>Cappuccino nice in desktop browser but 1.4MB, not compatible with iPhone.</li> <li>jQuery not as nice as the Cappuccino version but 106KB. iPhone compatible.</li> <li>I&rsquo;ll give a try to Dashcode 3.</li> </ul> </div> <hr /> <div class="intro"> <p>Before start, I must say I know Cappuccino and jQuery are no more comparable than Cocoa and the C++ standard library. One is oriented for user interface while the other is and helper for low level programming. Nonetheless I used these two to make the same web application. This is why I compare the expe...</p></div></hr> tag:yannesposito.com,2010-06-18:/Scratch/en/blog/2010-06-19-jQuery-popup-the-easy-way/ jQuery popup the easy way 2010-06-18T22:44:50Z 2010-06-18T22:44:50Z <p>Some source code on this blog can be downloaded. Most of time, the code is larger than the <code>div</code> bloc. This is why I use a method to show this code in a large jQuery popup. </p> <p>You can try clicking the following code&nbsp;; remark that the content is cutted a bit after <code>z-index</code>:</p> <div class="code"><div class="file"><a href="/Scratch/en/blog/2010-06-19-jQuery-popup-the-easy-way/code/essai.js"> &#x27A5; essai.js </a></div><div class="withfile"> <pre class="twilight"> <span class="Comment"><span class="Comment">//</span> --- code popup ---</span> <span class="Storage">function</span> <span class="Entity">openPopup</span>() { <span class="Keyword">$</span>(<span class="Variable">this</span>).clone(<span class="Constant">false</span>).appendTo(</pre></div></div> tag:yannesposito.com,2010-06-17:/Scratch/en/blog/2010-06-17-hide-yourself-to-analytics/ Hide Yourself to your Analytics 2010-06-17T14:37:22Z 2010-06-17T14:37:22Z <p>This is a way not to count your own visits to your blog. First you should look on how <a href="/Scratch/en/blog/2010-06-17-track-events-with-google-analytics">I handle analytics</a>. All analytics are handled in one javascript file, this make things really convenient.</p> <p>Then you need to know my method use the <code>jquery-cookie</code>.</p> <p>I check if the key <code>admin</code> is not set in the cookie before adding the visit.</p> <pre class="twilight"> <span class="Storage">var</span> admin <span class="Keyword">=</span> <span class="Keyword">$</span>.<span class="SupportConstant">cookie</span>(<span class="String"><span class="String">'</span>admin<span class="String">'</span></span>); <span class="Keyword">if</span> (<span class="Keyword">!</span> admin) { ...</pre> tag:yannesposito.com,2010-06-17:/Scratch/en/blog/2010-06-17-track-events-with-google-analytics/ Track Events with Google Analytics 2010-06-17T12:41:36Z 2010-06-17T12:41:36Z <p>Here is how to track all clicks on your website using google analytics asynchronously.</p> <p>First in your <span class="sc">html</span> you need to use <a href="http://jquery.com">jQuery</a> and a javscript file I named <code>yga.js</code>:</p> <pre class="twilight"> <span class="EmbeddedSource"> <span class="EmbeddedSource">&lt;</span><span class="MetaTagInline">script</span> <span class="MetaTagInline">type</span>=<span class="String"><span class="String">&quot;</span>text/javascript<span class="String">&quot;</span></span> <span class="MetaTagInline">src</span>=<span class="String"><span class="String">&quot;</span>jquery.js<span class="String">&quot;</span></span><span class="EmbeddedSource">&gt;</span><span class="EmbeddedSource">&lt;/</span><span class="MetaTagInline">scr...</span></span></pre> tag:yannesposito.com,2010-06-15:/Scratch/en/blog/2010-06-15-Get-my-blog-engine/ Get my blog engine 2010-06-15T08:56:32Z 2010-06-15T08:56:32Z <p>I published a <em>light</em> version of my blog engine based on <a href="http://nanoc.stoneship.org">nanoc</a> yesterday night. By <em>light</em>, I mean a lighter, more portable CSS (without round border). You can get it on <a href="http://github.com/yogsototh/nanoc3_blog">github.com</a>.</p> <p>What this system provide?</p> <ul> <li>All <a href="http://nanoc.stoneship.org">nanoc</a> advantages,</li> <li>Easy multi-language handling,</li> <li>Syntax Coloration for most languages,</li> <li><a href="http://intensedebate.org">intenseDebate</a> comments integration (asynchronous)&nbsp;;</li> <li>Portable with and without javascript, XHTML Strict 1.0 / CSS3,</li> <li>Write in markdown format (no HTML editing needed),</li> <li>Typographic ameliorations (no &lsquo;:&rsquo; ...</li></ul> tag:yannesposito.com,2010-06-14:/Scratch/en/blog/2010-06-14-multi-language-choices/ multi language choices 2010-06-14T14:14:57Z 2010-06-14T14:14:57Z <p>I translate most of my blog entries in French and English. Most people advice me to have one file per language. Generally it ends with:</p> <pre class="twilight"> Bonjour, voici un exemple de texte en français. [image](url) </pre> <pre class="twilight"> Hello, here is an example of english text. [image](url) </pre> <p>This way of handling translations force you to write completely an article in one language, copy it, and translate it.</p> <p>However, most of time, there are common parts like images, source code, etc&hellip; When I want to correct some mistake on these parts, I have to make twice the work. With sometimes adding another mistake in only one language.</p> <p>This is why I preferred to handle it differently. I use <em>tags</em> on a single file. Finally my files...</p> tag:yannesposito.com,2010-05-24:/Scratch/en/blog/2010-05-24-Trees--Pragmatism-and-Formalism/ Trees; Pragmatism and Formalism 2010-05-24T18:05:14Z 2010-05-24T18:05:14Z <div class="intro"> <p><abbr title="Too Long; Don't Read"><span class="sc">tl;dr</span></abbr>: </p> <ul> <li>I tried to program a simple filter</li> <li>Was blocked 2 days</li> <li>Then stopped working like an engineer monkey</li> <li>Used a pen and a sheet of paper</li> <li>Made some math.</li> <li>Crushed the problem in 10 minutes</li> <li>Conclusion: The pragmatism shouldn&rsquo;t mean &ldquo;never use theory&rdquo;.</li> </ul> </div> <h2 id="abstract-longer-than-abbr-titletoo-long-dont-readsctldrscabbr">Abstract (longer than <abbr title="Too Long; Don't Read"><span class="sc">tl;dr</span></abbr>)</h2> <p>For my job, I needed to resolve a problem. It first seems not too hard. Then I started working directly on my program. I entered in the <em>infernal</em>: ...</p> tag:yannesposito.com,2010-05-19:/Scratch/en/blog/2010-05-19-How-to-cut-HTML-and-repair-it/ How to repair a cutted XML? 2010-05-19T20:20:34Z 2010-05-19T20:20:34Z <p>For my main page, you can see, a list of my latest blog entry. And you have the first part of each article. To accomplish that, I needed to include the begining of the entry and to cut it somewhere. But now, I had to repair this cutted HTML.</p> <p>Here is an example:</p> <pre class="twilight"> <span class="MetaTagAll"><span class="MetaTagAll">&lt;</span><span class="MetaTagAll">div</span> <span class="MetaTagAll">class</span>=<span class="String"><span class="String">&quot;</span>corps<span class="String">&quot;</span></span><span class="MetaTagAll">&gt;</span></span> <span class="MetaTagAll"><span class="MetaTagAll">&lt;</span><span class="MetaTagAll">div</span> <span class="MetaTagAll">class</span>=<span class="String"><span class="String">&quot;</span>intro</span></span></pre> tag:yannesposito.com,2010-05-17:/Scratch/en/blog/2010-05-17-at-least-this-blog-revive/ I live again! 2010-05-17T11:25:51Z 2010-05-17T11:25:51Z <p>Hi all!</p> <blockquote cite="http://www.madore.org/~david/weblog/2010-05.html#d.2010-05-12.1752"> <p>The more you wait to do something, the more difficult it is to start doing it.</p> </blockquote> <p>I had to write another post for this blog. I had added many article idea in my todolist. But, I made many other things, and I&rsquo;ve always said (until now), I&rsquo;ll do this later. What changed my mind is the haunt of this simple remark about how to be productive in programming. </p> <blockquote> <p>Stop write <code>TODO</code> in your code and make it now!<br /> You&rsquo;ll be surprised by the results.</p> </blockquote> <p>In short:</p> <blockquote> <p><strong>Just do it!</strong> ou <strong>Juste fait le</strong> comme auraient dit les nuls.</p> </blockquote> <p>Final...</p></blockquote> tag:yannesposito.com,2010-03-23:/Scratch/en/blog/2010-03-23-Encapsulate-git/ Encapsulate git 2010-03-23T20:37:36Z 2010-03-23T20:37:36Z <div class="intro"> Here is a solution to maintain divergent branches in git. Because it is easy to merge by mistake. I give a script that encapsulate git in order to forbid some merge and warn you some merge should be dangerous. </div> <h2 id="how-to-protect-against-your-own-dumb">how to protect against your own dumb</h2> <p>I work on a project in which some of my git branches should remain divergent. And divergences should grow.</p> <p>I also use some branch to contain what is common between projects.</p> <p>Say I have some branches:</p> <p>master: common to all branches dev: branch devoted to unstable development client: branch with features for all client but not general enough for master clientA: project adapted for client A clientB: project adapted for client B</p> <p>Her...</p> tag:yannesposito.com,2010-03-22:/Scratch/en/blog/2010-03-22-Git-Tips/ Git Tips 2010-03-22T08:42:27Z 2010-03-22T08:42:27Z <h2 class="first" id="clone-from-github-behind-an-evil-firewall">clone from github behind an evil firewall</h2> <p>Standard:</p> <div><pre class="twilight"> git clone git@github.com:yogsototh/project.git </pre></div> <p>Using HTTPS port:</p> <div><pre class="twilight"> git clone git+ssh://git@github.com:443/yogsototh/project.git </pre></div> <h2 id="clone-all-branches">clone all branches</h2> <p><code>git clone</code> can only fetch the master branch.</p> <p>If you don&rsquo;t have much branches, you can simply use clone your project and then use the following command:</p> <div><pre class="twilight"> git branch --track local_branch remote_branch </pre></div> <p>for example:</p> <div><pre class="twilight"> $ git clone git@github:yogsototh/example.git $ git branch master * $ git ...</pre></div> tag:yannesposito.com,2010-02-23:/Scratch/en/blog/2010-02-23-When-regexp-is-not-the-best-solution/ When regexp is not the best solution 2010-02-23T08:09:52Z 2010-02-23T08:09:52Z <p>Regular expression are really useful. Unfortunately, they are not always the best way of doing things. Particularly when transformations you want to make are easy.</p> <p>I wanted to know how to get file extension from filename the fastest way possible. There is 3 natural way of doing this:</p> <div><pre class="twilight"> <span class="Comment"><span class="Comment">#</span> regexp</span> str.<span class="Entity">match</span>(<span class="StringRegexp"><span class="StringRegexp">/</span></span><span class="StringRegexp"><span class="StringRegexp"><span class="StringRegexp">[</span>^.<span class="StringRegexp">]</span></span>*$</span><span class="StringRegexp"><span class="StringRegexp">/</span></span>); ext<span class="Keyword">=</span><span class="Variable"><span class="Variable">...</span></span></pre></div> tag:yannesposito.com,2010-02-18:/Scratch/en/blog/2010-02-18-split-a-file-by-keyword/ split a file by keyword 2010-02-18T13:29:14Z 2010-02-18T13:29:14Z <p>Strangely enough, I didn&rsquo;t find any built-in tool to split a file by keyword. I made one myself in <code>awk</code>. I put it here mostly for myself. But it could also helps someone else. The following code split a file for each line containing the word <code>UTC</code>.</p> <div><pre class="twilight"> <span class="Comment"><span class="Comment">#</span>!/usr/bin/env awk</span> <span class="Entity">BEGIN</span>{i=0;} <span class="StringRegexp"><span class="StringRegexp">/</span>UTC<span class="StringRegexp">/</span></span> { i+=1; FIC=<span class="SupportFunction">sprintf</span>(<span class="String"><span class="String">&quot;</span>fic.%03d<span class="String">&quot;</span></span>,i); } {<span class="SupportFunction">print</span> <span class="Variable"></span></pre></div> tag:yannesposito.com,2010-02-16:/Scratch/en/blog/2010-02-16-All-but-something-regexp--2-/ Pragmatic Regular Expression Exclude (2) 2010-02-16T08:33:21Z 2010-02-16T08:33:21Z <p>In my <a href="previouspost">previous post</a> I had given some trick to match all except something. On the same idea, the trick to match the smallest possible string. Say you want to match the string between &lsquo;a&rsquo; and &lsquo;b&rsquo;, for example, you want to match:</p> <pre class="twilight"> a.....<span class="Constant"><strong>a......b</strong></span>..b..a....<span class="Constant"><strong>a....b</strong></span>... </pre> <p>Here are two common errors and a solution:</p> <pre class="twilight"> /a.*b/ <span class="Constant"><strong>a.....a......b..b..a....a....b</strong></span>... </pre> <p>The first error is to use the <em>evil</em> <code>.*</code>. Because you will match from the first to the last.</p> <pre class="twilight"> /a.*?b/ <span class="Constant"><strong>...</strong></span></pre> tag:yannesposito.com,2010-02-15:/Scratch/en/blog/2010-02-15-All-but-something-regexp/ Pragmatic Regular Expression Exclude 2010-02-15T09:16:12Z 2010-02-15T09:16:12Z <p>Sometimes you cannot simply write:</p> <div><pre class="twilight"> <span class="Keyword">if</span> str.<span class="Entity">match</span>(regexp) <span class="Keyword">and</span> <span class="Keyword">not</span> str.<span class="Entity">match</span>(other_regexp) do_something </pre></div> <p>and you have to make this behaviour with only one regular expression. The problem is the complementary of regular languages is not regular. Then, for some expression it is absolutely not impossible.</p> <p>But sometimes with some simple regular expression it should be possible<sup><a href="#note1">&dagger;</a></sup>. Say you want to match everything containing the some word say <code>bull</code> but don&rsquo;t want to match <code>bullshit</code>. Here is a nice way to do that:</p>... tag:yannesposito.com,2010-01-12:/Scratch/en/blog/2010-01-12-antialias-font-in-Firefox-under-Ubuntu/ antialias font in Firefox under Ubuntu 2010-01-12T14:36:40Z 2010-01-12T14:36:40Z <p>How to stop using bad Microsoft© font under Ubuntu Linux in order to user nice anti aliased font under Firefox.</p> <p>Just modify the <code>/etc/fonts/local.conf</code> with the following code: </p> <div> <div class="code"><div class="file"><a href="/Scratch/en/blog/2010-01-12-antialias-font-in-Firefox-under-Ubuntu/code/local.conf"> &#x27A5; local.conf </a></div><div class="withfile"> <pre class="twilight"> <span class="DoctypeXmlProcessing"><span class="DoctypeXmlProcessing">&lt;?</span><span class="DoctypeXmlProcessing">xml</span><span class="DoctypeXmlProcessing"> version</span>=<span class="DoctypeXmlProcessing"><span class="DoctypeXmlProcessing">&quot;</span>1.0<span class="DoctypeXmlProcessing">&quot;</span></span><span class="DoctypeXmlProcessing">?&gt;</span></span> </pre></div></div></div> tag:yannesposito.com,2010-01-04:/Scratch/en/blog/2010-01-04-Change-default-shell-on-Mac-OS-X/ Change default shell on Mac OS X 2010-01-04T10:31:47Z 2010-01-04T10:31:47Z <p>I just found a way to change the default shell on Mac OS X. This note is mostly for me, but somebody else should find it useful. Just launch the following command: </p> <div><pre class="twilight"> <span class="Keyword">&gt;</span> chsh </pre></div> tag:yannesposito.com,2009-12-14:/Scratch/en/blog/2009-12-14-Git-vs--Bzr/ Git vs. Bzr 2009-12-14T08:46:36Z 2009-12-14T08:46:36Z <div class="intro"> <p>Why even if I believe <code>git</code> has many bad point I believe it is the best DCVS around to work with. This is why I first tell why I prefer <a href="http://bazaar-vcs.org">Bazaar</a> over <a href="http://git-scm.org">Git</a>. Secondly I&rsquo;ll talk about the only advantage of git against Bazaar which lead me to prefer it.</p> </div> <h2 id="the-dcvs-discovery">The DCVS discovery</h2> <p>Before beginning this article, you should know I come from <em>subversion</em>. I find subversion to be a really good CVS. But I was converted to the decentralized ones.</p> <p>There is two way of perceive version control system. Either you think in term of branches (see the really good article on </p> tag:yannesposito.com,2009-12-06:/Scratch/en/blog/2009-12-06-iphone-call-filter/ iphone call filter 2009-12-06T09:35:34Z 2009-12-06T09:35:34Z <p>It is unbelievable you cannot filter your call with an iPhone! The only reason I see for that is a negotiation with phone operator to force users to get phone advertising. It is simple unacceptable.</p> <p>I&rsquo;m a λ iPhone&rsquo;s user. The only way to filter your call and to manage blacklist is to <em>jailbreak</em> your iPhone. And I don&rsquo;t want to do that. Then, if like me you find it unacceptable, just write a line to Apple: <a href="http://www.apple.com/feedback/iphone.html">http://www.apple.com/feedback/iphone.html</a></p> tag:yannesposito.com,2009-11-12:/Scratch/en/blog/2009-11-12-Git-for-n00b/Git-pour-quoi-faire/ Git for n00b 2009-11-12T09:39:54Z 2009-11-12T09:39:54Z <h1 class="first" id="gitgit-for-what"><a href="http://git-scm.org" title="Git">Git</a> for what?</h1> <div class="intro"> <p>If you just want to use <a href="http://git-scm.org" title="Git">Git</a> <strong>immediately</strong>, just read dark part. You read this part later to understand correctly foundations of version systems and not doing strange things.</p> </div> <p><a href="http://git-scm.org" title="Git">Git</a> is a <abbr title="Decentralized Concurent Versions System">DCVS</abbr>, which means a Decentralized Concurrent Versions System. Let&rsquo;s analyze each part of this long term:</p> <h3 id="versions-system">Versions System</h3> <p>Firstly, versions system manage files. When somebody work with files without a versions system, the following happens frequently:</p> ... tag:yannesposito.com,2009-11-12:/Scratch/en/blog/2009-11-12-Git-for-n00b/commandes-avancees/ Git for n00b 2009-11-12T09:39:54Z 2009-11-12T09:39:54Z <h1 class="first" id="command-list">Command List</h1> <h2 id="command-for-each-functionality">Command for each functionality</h2> <p>In the first part, we saw the list of resolved problem by <a href="http://git-scm.org" title="Git">Git</a>. To resume <a href="http://git-scm.org" title="Git">Git</a> should do:</p> <ul> <li>get others modifications,</li> <li>send modifications to others,</li> <li>get back in time,</li> <li>list differences between each version,</li> <li>name some versions in order to refer easily to them,</li> <li>write an historic of modifications,</li> <li>know who did what and when,</li> <li>manage conflicts,</li> <li>easily manage branches.</li> </ul> <h3 id="get-others-modifications">get others modifications</h3> <div><pre class="twilight"> $ g...</pre></div> tag:yannesposito.com,2009-11-12:/Scratch/en/blog/2009-11-12-Git-for-n00b/ Git for n00b 2009-11-12T09:39:54Z 2009-11-12T09:39:54Z <div class="intro"> <p>A detailed tutorial of <a href="http://git-scm.org">Git</a> for people knowing very few about versions systems. You&rsquo;ll understand utility of such program and how we use modern version control system. I try to stay as pragmatic as possible.</p> </div> </div> <div class="corps"> <h1 class="first" id="begin-with-conclusion">Begin with conclusion</h1> <p>Here is the list of sufficient and necessary command to use <a href="http://git-scm.org" title="Git">Git</a>. There is very few. It is normal not to understand immediately but it is to gives you an idea. Even if this article is long, 95% of <a href="http://git-scm.org" title="Git">Git</a> usage is in these 7 commands:</p> <p>Get a project from the web: </p> <div><pre class="twilight"> git clone ssh...</pre></div> tag:yannesposito.com,2009-11-12:/Scratch/en/blog/2009-11-12-Git-for-n00b/c-est-parti-pour-l-aventure/ Git for n00b 2009-11-12T09:39:54Z 2009-11-12T09:39:54Z <h1 class="first" id="here-we-go">Here we go!</h1> <p>Here is one from many way to use <a href="http://git-scm.org" title="Git">Git</a>. This method is sufficient to work on a project. Not there is many other <em>workflows</em>.</p> <h2 id="basic-usage">Basic usage</h2> <p>Work with <a href="http://git-scm.org" title="Git">Git</a> immediately:</p> <ul> <li>Get modification done by others <span class="black"><code>git pull</code></span>,</li> <li>See details of these modifications <span class="black"><code>git log</code></span>,</li> <li>Many times: <ul> <li><em>Make an atomic modification</em></li> <li>Verify details of this modification: <span class="black"><code>git status</code></span> and <span class="black"><code>git diff</code></span>,</li> <li>Add ...</li></ul></li></ul> tag:yannesposito.com,2009-11-12:/Scratch/en/blog/2009-11-12-Git-for-n00b/comprendre/ Git for n00b 2009-11-12T09:39:54Z 2009-11-12T09:39:54Z <h1 class="first" id="why-git-is-cool">Why Git is cool?</h1> <p>Because with <a href="http://git-scm.org" title="Git">Git</a> you can work on many part of some project totally independently. This is the true efficiency of decentralisation.</p> <p>Each branch use the same directory. Then you can easily change your branch. You can also change branch when some files are modified. You can then dispatch your work on many different branches and merge them on one master branch at will.</p> <p>Using the <code>git rebase</code> you can decide which modifications should be forget or merged into only one modification.</p> <p>What does it mean for real usage? You can focus on coding. For example, you can code, a fix for bug b01 and for bug b02 and code a feature f03. Once finished you can creat...</p> tag:yannesposito.com,2009-11-12:/Scratch/en/blog/2009-11-12-Git-for-n00b/conf-et-install/ Git for n00b 2009-11-12T09:39:54Z 2009-11-12T09:39:54Z <h1 class="first" id="before-usage-configuration">Before usage, configuration</h1> <h2 id="install">install</h2> <p>Under Linux Ubuntu or Debian:</p> <div><pre class="twilight">$ sudo apt-get install git </pre></div> <p>Under Mac OS X:</p> <ul> <li>install <a href="http://macports.org/install.php">MacPorts</a></li> <li>install <a href="http://git-scm.org" title="Git">Git</a></li> </ul> <div><pre class="twilight"> $ sudo port selfupdate $ sudo port install git-core </pre></div> <h2 id="global-configuration">Global configuration</h2> <p>Save the following file as your <code>~/.gitconfig</code>.</p> <div><div class="code"><div class="file"><a href="/Scratch/en/blog/2009-11-12-Git-for-n00b/conf-et-install/code/gitconfig"> &#x27A5; gitconfig </a></div><div class="withfile"> </div></div></div> tag:yannesposito.com,2009-10-30:/Scratch/en/blog/2009-10-30-How-to-handle-evil-IE/ How to handle evil IE 2009-10-30T20:34:46Z 2009-10-30T20:34:46Z <p>For developer IE is a nightmare. This is why, I use a method to disable my standard CSS and enable a IE only CSS. I use jQuery to accomplish that.</p> <div><pre class="twilight"> <span class="Keyword">$</span>(<span class="Support">document</span>).ready( <span class="Storage">function</span>() { <span class="Keyword">if</span> (<span class="Keyword">$</span>.browser[<span class="String"><span class="String">&quot;</span>msie<span class="String">&quot;</span></span>]) { <span class="Comment"><span class="Comment">//</span> include the ie.js file</span> <span class="Keyword">$</span>(<span class="String"><span class="String">'</span>head<span class="String">'</span></span>).append(<span class="String"><span class="String">'</span>&lt;script type=&quot;text/javascr...</span></pre></div> tag:yannesposito.com,2009-10-28:/Scratch/en/blog/2009-10-28-custom-website-synchronisation-with-mobileme--2-/ custom website synchronisation with mobileme (2) 2009-10-28T09:03:30Z 2009-10-28T09:03:30Z <p>I already talked about how <a href="/Scratch/en/blog/10_Synchronize_Custom_WebSite_with_mobileMe">I synchronized my website with mobileme</a>. I ameliorated this script in order to make it incremental.</p> <p>Here is my new script, it first create a map which associate to each file its hash. After that it compare this file to the remote one. Then for each different file, update the content.</p> <p>Even with this script I also have some problem. Mostly due to &lsquo;webdav&rsquo; issues. For example, renaming a folder work really badly (on Linux at least). I use webdavfs. For example:</p> <div><pre class="twilight"> mv folder folder2 </pre></div> <p>It returns OK and I&rsquo;ve got: </p> <div><pre class="twilight"> $ ls folder folder2 </pre></div> <p>Booh&hellip;.</p> <p>In or...</p> tag:yannesposito.com,2009-10-26:/Scratch/en/blog/2009-10-Wait-to-hide-a-menu-in-jQuery/ Menu waiting to hide himself 2009-10-26T19:56:09Z 2009-10-26T19:56:09Z <p>I discussed <a href="/Scratch/en/blog/2009-10-Focus-vs-Minimalism">earlier why I prefer to hide my navigation menu</a>. I finally decided to hide it only after a short time. Just the time needed for a user to see it. But how make it disappear only when it is not used for some time?</p> <p>Here is how to accomplish that easily.</p> <p>HTML: </p> <div> <pre class="twilight"> <span class="MetaTagAll"><span class="MetaTagAll">&lt;</span><span class="MetaTagAll">div</span> <span class="MetaTagAll"><span class="MetaTagAll">id</span><span class="MetaTagAll">=</span><span class="String"><span class="String">&quot;</span><span class="String">menuButton</span><span class="String">&quot;</span></span></span><span class="MetaTagAll">&gt;<span class="MetaTagAll">&lt;</span>/</span></span></pre></div> tag:yannesposito.com,2009-10-23:/Scratch/en/blog/2009-10-launch-daemon-from-command-line/ launch daemon from command line 2009-10-23T08:53:16Z 2009-10-23T08:53:16Z <p>Here is a tip, I don&rsquo;t know why, but I almost always forgot how to do that.</p> <p>When you want to launch a command and this command should not be killed after you close your terminal. Here is how to accomplish that from command line: </p> <div><pre class="twilight"> nohup cmd <span class="Keyword">&amp;</span> </pre> <small>where <code>cmd</code> is your command.</small> </div> <p>I let this command here for me and I wish it could also help someone.</p> tag:yannesposito.com,2009-10-22:/Scratch/en/blog/2009-10-Focus-vs-Minimalism/ Focus &gt; Minimalism 2009-10-22T18:45:18Z 2009-10-22T18:45:18Z <p>I believe the goal researched by minimalism is <strong>Focus</strong>. But I don&rsquo;t believe minimalism should be the goal. Focus should be the goal, and I believe minimalism isn&rsquo;t necessary to reach it.</p> <p>This is why my design is not minimalist, but I decided to remove most of the navigation stuff of all pages of my website. May be I&rsquo;ll prefer to hide the menu only when you are on blog article. For now, I hide the menu everywhere on the website.</p> </div> <div class="corps"> <h2 class="first" id="technical-details">technical details</h2> <p>For those who want the technical details behind the show/hide menu, here is the simple jQuery code.</p> <p>The HTML: </p> <div> <pre class="twilight"> <span class="MetaTagAll"><span class="MetaTagAll">&lt;</span></span></pre></div> tag:yannesposito.com,2009-10-13:/Scratch/en/blog/2009-10-untaught-git-usage/ Untaught Git usage 2009-10-13T11:10:09Z 2009-10-13T11:10:09Z <p><small> <em>I explain why I had so much difficulties to use Git. There is an &ldquo;untaught rule&rdquo; that make hard to work without. Until I read the good document. </em></small></p> <p><small> <em> &ldquo;Cheap branches&rdquo; aren&rsquo;t designed to be totally isolated branches but rather should follow a &ldquo;Master Branch&rdquo;. There is a </em>Standard Workflow<em> to follow. If you don&rsquo;t follow it, you prepare yourself with some hard time with Git.</em> </small></p> </div> <div class="corps"> <h1 class="first" id="my-way-to-decentralisation">My way to decentralisation</h1> <h3 id="from-svn-to-bazaar">From SVN to Bazaar</h3> <p>I was a huge user of <a href="http://subversion.tigris.org">subversion (svn)</a>. Until the day I saw this </p> tag:yannesposito.com,2009-10-03:/Scratch/en/blog/2009-10-How-to-preload-your-site-with-style/ How to preload your site with style 2009-10-03T12:34:11Z 2009-10-03T12:34:11Z <h2 class="first" id="example">Example</h2> <p>Here is a live example of what appear while loading my pages.</p> <div id="demo" style="width:45%; position: relative; height: 8em; background-image: url('/Scratch/css/img/red.jpg'); background-position: 50% 50%; color: #fff; text-align: center; padding-top: 1em; margin-left: auto; margin-right: auto; border: solid 10px rgba(255,255,255,0.7); -webkit-border-radius: 1em; -moz-border-radius: 1em; border-radius: 1em; cursor: pointer; "> <p>Hello! I've finished loading!</p> <p>Click me to see me disapear again.</p> <div id="todisapear" style="color: #000; position:absolute;top:0;left:0;text-align: center; padding-top: 1em; width: 100%; background-color: #eee; height: 8em;"> Loading... </div></div> tag:yannesposito.com,2009-09-28:/Scratch/en/blog/2009-09-Disqus-versus-Intense-Debate--Why-I-switched-/ Disqus versus Intense Debate (Why I switched) 2009-09-28T08:58:20Z 2009-09-28T08:58:20Z <h1 class="first" id="disqushttpdisquscom-vs-intense-debatehttpintensedebatecom"><a href="http://disqus.com/">Disqus</a> <em>vs.</em> <a href="http://intensedebate.com/">Intense Debate</a></h1> <p>I made a blog entry about how I tried to integrate <a href="http://disqus.com">Disqus</a>. I had to wait Disqus comment to be displayed before loading correctly my page. This is why I tried to include it in a &ldquo;non-blocking&rdquo; way. Unfortunately, I had <a href="/Scratch/en/blog/11_Load_Disqus_Asynchronously/">difficulties to make it works correctly</a>. </p> <p>Furthermore, it was not trivial to make comment to be shared between multiple version of the same page (each page has three differents representations, one for each language and one more for the multi-language version).</p> ... tag:yannesposito.com,2009-09-23:/Scratch/en/blog/2009-09-jQuery-Tag-Cloud/ jQuery Tag Cloud 2009-09-23T11:18:26Z 2009-09-23T11:18:26Z <p>Here is how I done the tag cloud of my blog. It is done mostly in jQuery. All my site is static and pages are generated with <a href="nanoc.stoneship.org">nanoc</a>. It is (in my humble opinion) the modern geek way to make a website. The tagcloud should work for machine with and without javascript.</p> <p>This is why I&rsquo;ll give only a Ruby Generator, not a full javascript generator. But you can easily translate from Ruby to Javascript.</p> <p>Here is what you should obtain:</p> </div> <div class="corps"> <div> <script type="text/javascript"> $(document).ready( function(){$('.list').hide();$('#tagcloud a').removeAttr("href")} ); function tagSelected(id) { $('.list').hide(); $('#'+id).fadeIn(); $('.ta...</script></div> tag:yannesposito.com,2009-09-22:/Scratch/en/blog/2009-09-replace-all-except-some-part/ replace all except some part 2009-09-22T20:13:25Z 2009-09-22T20:13:25Z <p>My problem is simple:</p> <p>I want to filter a text except some part of it. I can match easily the part I don&rsquo;t want to be filtered. For example</p> <div> <pre class="twilight"> ... text ... BEGIN not to filter ... text ... END not to filter ... text ... </pre> </div> <p>I searched a better way to do that, but the best I can do is using <code>split</code> and <code>scan</code>.</p> <div> <pre class="twilight"> <span class="Keyword">def</span> <span class="Entity">allExceptCode</span>(<span class="Variable"> f<span class="Variable">,</span> content </span>) regexp<span class="Keyword">=</span><span class="StringRegexp"><span class="StringRegexp">/</span></span><span class="StringRegexp">&lt;code<span class="StringRegexp"><span class="StringRegexp">[</span>^&gt;</span></span></pre></div> tag:yannesposito.com,2009-09-17:/Scratch/en/blog/11_Load_Disqus_Asynchronously/ Load Disqus Asynchronously 2009-09-17T21:27:54Z 2009-09-17T21:27:54Z <h1 class="first" id="update">Update</h1> <p>In fact this method works for old threads. But it fails to create new post threads. This is why I tried and be conquered by <a href="http://intensedebate.com">intensedebate</a>, as you can see in the bottom of this page.</p> <p>Remark I didn&rsquo;t have any comment on my blog when I switched. Therefore my lack of influence was a good thing&nbsp;:-).</p> </div> <div class="corps"> <p>Before begining, I must state that I <strong>love</strong> Disqus. </p> <p>I know there is a similar blog entry at <a href="http://trephine.org/t/index.php?title=Site_improvements_-_fighting_with_Disqus">Trephine.org</a>. Here I just add a straight and easy way to load disqus asynchronously using jQuery. </p> <p>I also know there is a jQuery plugin to ma...</p>