Thursday, March 29, 2012

Bundler, oh, I hate thou

Another merry joke from my bundler friend. If you ever switch to deployment mode (using the bundle install --deployment command), do not come and cry if bundler starts staying:
Could not find gemname-version in any of the sources
When you have :
gem list
*** LOCAL GEMS ***
gemname (version)
Instead remove the lock

bundle install --no-deployment

And voilà.

Short post, but this issue made me mad for half an hour.

Wednesday, March 28, 2012

Blog Styling

This article describes the way I style things in this blog.

Blockquotes

 I use the following CSS styles for my blockquotes. Final result is:

Example of styled blockquote


blockquote{
  background:#f9f9f9;
  border-left:1em solid #eee;
  margin:1.5em 1em;
  padding:.5em 1em;
  quotes:"\201C""\201D";
  font: italic normal 12pt/1.2em Georgia;
}

blockquote:before{
  color:#808080;
  content:open-quote;
  font-size:4em;
  line-height:.1em;
  margin-right:.25em;
  vertical-align:-.4em;
}

blockquote :first-child{display:inline;}
blockquote :last-child{margin-bottom:0;}

Code block

For code blocks, I use the following style:

pre {
        border:1px dashed #E1E1E1;
        color:#333344;
        background:#FAFAFA;
        font-family:monospace;
        overflow:auto;
        font-size:11px;
        padding:0.5em;
}

A pinterest spammer talks

Very interesting article that show that Pinterest has still some way to do and can definitely be bankable more or less quickly. People like this guy are really innovating. All the more so as this is almost useful spam in the Pinterest galaxy.

http://www.dailydot.com/news/pinterest-steve-amazon-spammer-tells-all/
First week of doing this I made around $2,000

Wednesday, March 21, 2012

Les espaces insécables sous OSX

Hej,

J'ai lu hier l'article de Bruno Michel qui parle des espaces insécables pour les développeurs et je me suis rappelé de l'horreur qu'il y a à taper sous OSX, avec un clavier français les commandes suivantes:


ps aux | grep toto

En général, on relache les touches alt+shift un tout petit peu trop tard et le clavier OSX nous colle alors un joli espace insécable à la place de l'espace classique juste après le pipe :


ps auxw | grep window
zsh: command not found:  grep

C'est vraiment très embêtant et rageant, surtout quand on est pressé...

Pour contourner le problème, j'ai téléchargé Ukelele et j'ai modifié la méthode de saisie française pour que cette séquence de frappe génère une espace classique.

Et voilà: http://people.zoy.org/~oct/public/blogger/2012-03-21-French-no-bsp.bundle.zip

Pour installer cette chose, dézippez la quelque part sur votre Mac et copiez le répertoire .bundle dans votre ~/Library.

L'icône de la méthode de saisie vient de http://www.fasticon.com/ (j'aime bien ces petits bonhommes un peu ridicules).


Happy Coding !


Monday, March 12, 2012

Open-uri preventing redirects from https to http

Because it assumes it's insecure. That's quite annoying and should be configurable.




def OpenURI.redirectable?(uri1, uri2)
  true
end
This monkey-patch fixes the issue and remove the check.

A bug exists for the stdlib http://bugs.ruby-lang.org/issues/859 but fixes just the other way round.

Ruby-io-tail at version 0.0.3

The new version of ruby-io-tail will start to tail files from the end, and not from the first line available. This is useful to ensure no lines is sent twice to the Tailing application.

As usual, the gem is available from: https://rubygems.org/gems/io-tail

Sunday, March 11, 2012

Sortie de ruby io tail

Ruby-io-tail est une bibliothèque qui vous permet de lire automatiquement la fin d'un fichier de journal ou la sortie d'un processus, depuis Ruby en utilisant des blocks comme Ruby peut en proposer. Le code est libéré sous license GPL et la documentation en anglais est également disponible.

Parmi les fonctionnalités disponibles, vous pouvez créer un groupe d'IO à suivre et appeler un seul point d'entrée qui vous rappelle à chaque nouvelle ligne à lire dans un des ces IOs. De plus, en cas de fermeture abrupte d'un fichier, ou si le processus meurt, vous avez la possibilité de réouvrir automatiquement le fichier ou de relancer automatique le fichier.

Ce project est un fork amical de Florian Frank ( l'auteur de https://github.com/flori/file-tail) auquel j'ai rajouté la possibilité de suivre la sortie d'un processus extérieur.

Pour plus d'information:

- La page de documentation du projet : http://rubydoc.info/github/octplane/ruby-io-tail/file/README.rdoc
- Le project sur Github : https://github.com/octplane/ruby-io-tail