<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> A simple yesod tutorial. Yesod is an Haskell web framework. You shouldn&rsquo;t need to know Haskell. </p>
<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> How to use m4 to increase the power of deficient languages. Two examples: improve <span class="sc">xslt</span> syntax and make fractal with <span class="sc">svg</span>.</p>
Then some believed it would be a good idea to invent many <span class="sc">xml</span> compatible format and even programming languages with <span class="sc">xml</span> syntax.</p>
<p><a href="http://www.yesodweb.com">Yesod</a> is a web framework which recently reached the maturity for which you should consider to use it.
Before telling you why you should learn Haskell and use yesod, I will talk about ideas yesod introduced and I didn&rsquo;t saw in other frameworks before.</p>
<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> some simple implementation of higher order function for zsh.</p>
</div>
<p>Why is it important to have these functions?
Simply because, the more I programmed with zsh the more I tended to work using functional programming style.</p>
<p>The minimal to have better code are the functions <code>map</code>, <code>filter</code> and <code>fold</code>.</p>
<p>Let&rsquo;s compare.
First a program which convert all gif to png in many different directories of different projects.</p>
<p>Before ⇒</p>
<pre class="twilight">
<span class="Comment"><span class="Comment">#</span> for each directory in...</span></pre></p></content>
<span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> My short and higly subjective feelings about programming languages I used.
I was about 10, with an <code>MO5</code> and <code>Amstrad CPC 6128</code> and even with my <code>Atari STe</code>.
This is the language of <code>GOTO</code>s.
<contenttype="html"><p><img alt="Über leet use vim!" src="/Scratch/img/blog/Learn-Vim-Progressively/uber_leet_use_vim.jpg" /></p>
<div class="intro">
<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> Want to learn vim (the best text editor known to human kind) the fastest way possible. I suggest you a way. Start by learning the minimal to survive, then integrate slowly all tricks.</p>
</div>
<p><a href="http://www.vim.org">Vim</a> the Six Billion Dollar editor</p>
<blockquote>
<p>Better, Stronger, Faster.</p>
</blockquote>
<p>Learn <a href="http://www.vim.org">vim</a> and it will be your last text editor.
There isn&rsquo;t any better text editor I know.
Hard to learn, but incredible to use.</p>
<p>I suggest you to learn it in 4 steps:</p>
<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> How I manage safely my password with success for some years now.<br />
I use a different password on all website.</p>
</div>
<p>Disclamer, this is an unashamed attempt to make you download my iPhone app&nbsp;;-).
You&rsquo;re always here?
Even if you won&rsquo;t download my app, you should read more.
My method doesn&rsquo;t necessitate my app.
It is both safe and easy to use everyday.</p>
<p>If you just want to <em>use</em> the tools without searching to understand why it is safe, just jump at the </p></p></div></p></content>
<p><em>Update</em>: I might change my mind now. Why?
I just discovered a <a href="https://github.com/rstacruz/js2coffee">js2coffee converter</a>. Furthermore Denis Knauf told me about a <code>CoffeeScript.eval</code> function.
And as Denis said: &ldquo;it is time to use Coffeescript as a javascript with Ruby-like syntax not a Ruby-like programming language&rdquo;.</p>
</div>
<div class="intro">
<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> I would have loved to program client side using a Ruby-like syntax. But in the end, CoffeScript raised more disavantages than advantages.</p>
</div>
<p>Recently I read </p></p></content>
<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> I made a simple macro system for my blog. Now I juste have to write %<span></span>latex and it show as <span style="text-transform: uppercase">L<sup style="vertical-align: 0.15em; margin-left: -0.36em; margin-right: -0.15em; font-size: .85em">a</sup>T<sub style="vertical-align: -0.5ex; margin-left: -0.1667em; margin-right: -0.125em; font-size: 1em">e</sub>X</span>.</p>
</div>
<p>I added a macro system for my blog system.
When we are used to <span style="text-transform: uppercase">L<sup style="vertical-align: 0.15em; margin-left: -0.36em; margin-right: -0.15em; font-size: .85em">a</sup>T</span></p></content>
<p><span class="sc"><abbr title="Too long; didn't read">tl;dr</abbr>: </span> Played to process a <code>wav</code> file. <code>C</code> was easier and cleaner than Ruby.</p>
<p>edit: I wanted this program to work only on one specific machine (a x86 on a 32 bit Ubuntu). Therefore I didn&rsquo;t had any portability consideration. This is only a <em>hack</em>.</p>
</div>
<p>I had to compute the sum of the absolute values of data of a <code>.wav</code> file.
For efficiency (and fun) reasons, I had chosen <code>C</code> language.</p>
<p>I didn&rsquo;t programmed in <code>C</code> for a long time.
From my memory it was a pain to read and write to files.
But in the end I was really impressed by the code I get.
It was really clean.
This is even more impressive know...</p></content>
<li>Get a certificate signed by a CA: <a href="http://www.instantssl.com/ssl-certificate-products/free-email-certificate.html">click here for a free one</a>,</li>
<li>open the file,</li>
<li>delete securely the file,</li>
<li>use Mail instead of online gmail.</li>
<li>???</li>
<li>Profit</li>
</ul>
</div>
<p>I&rsquo;ve (re)discovered how to become S/MIME compliant.
I am now suprised how easy it was.
Some years ago it was far more difficult.
Now I&rsquo;m able to sign and encrypt my emails.</p>
here are two functions to add to your code to have <code>base64</code> and <code>hexadecimal</code> version of the <code>sha1</code> hash of an NSString.</p>
<p>To use it, simply copy the code in your class and use as this:</p>
<contenttype="html"><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><sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> file:</p>
<p><span class="sc"><abbr title="Too long; didn'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>
<contenttype="html"><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></content>
<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 exp...</p></div></hr></content>
<contenttype="html"><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>
<contenttype="html"><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>
<contenttype="html"><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>
<contenttype="html"><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.
<contenttype="html"><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>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.
&gt; Stop write <code>TODO</code> in your code and make it now!<br />
&gt; You&rsquo;ll be surprised by the results.</p>
<p>In short:
&gt; <strong>Just do it!</strong> ou <strong>Juste fait le</strong> comme auraient dit les nuls.</p>
<p>Finally I&rsquo;ll certainly write blog post more often for a ...</p></p></content>
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
<contenttype="html"><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>
<contenttype="html"><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>
<p>The first error is to use the <em>evil</em><code>.*</code>. Because you will match from the first to the last.</p>
<p>and you have to make this behaviour with only one regular expression.
But, there exists a major problem: the complementary of a regular language might not be regular.
Then, for some expression it is absolutely impossible to negate a regular expression.</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 </p></content>
<contenttype="html"><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>
<contenttype="html"><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>