Skip to content

Instantly share code, notes, and snippets.

@jblanche
jblanche / .zshrc
Created January 7, 2012 18:17
awesome alias for new git projects
# gitdir : mkdir, cd to it, init git, create initial empty commit
# usage gitdir projectName
function gitdir() {
mkdir -p "$1" && cd "$1" && git init && git commit --allow-empty -m 'initial commit';
}
@jblanche
jblanche / lemonde-cleaner.js
Created January 3, 2012 11:42
leMonde cleaner
jQuery('.listLink').replaceWith(function(){
return jQuery(this).text();
});
@jblanche
jblanche / links.txt
Created December 16, 2011 16:10
Paleofuture seen by the CRMA2013 Gobelins students
@jblanche
jblanche / Gemfile
Created December 6, 2011 13:06
bundler error
source 'http://rubygems.org'
gem 'locomotive_cms', :git => 'git://github.com/locomotivecms/engine.git', :require => 'locomotive/engine'
gem 'unicorn', :group => 'development'
gem 'haml', :group => 'development'
gem 'mime-types', '~> 1.17.2'
gem 'unicorn'
gem 'faker'
@jblanche
jblanche / install.rdf
Created November 28, 2011 10:58
install.rdf
<?xml version="1.0" encoding="UTF-8"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>[email protected]</em:id>
<em:type>2</em:type>
<em:name>Enjoy Reading</em:name>
<em:version>0.2.2</em:version>
<em:creator>Jonathan Blanchet</em:creator>
<em:contributor></em:contributor>
<em:iconURL>chrome://enjoyreading/skin/logo.png </em:iconURL>
# Avec Rails on écrirait :
def create
@product = Product.create({name => 'A Foo Bar', price => 19.99, description => 'Lorem ipsum dolor'})
end
# ou plutôt (pour gérer les validations et redirections, non gérées dans l'exemple Symfony)
def create
@product = Product.new({name => 'A Foo Bar', price => 19.99, description => 'Lorem ipsum dolor'})
if @product.save
@jblanche
jblanche / typeParams.rb
Created November 22, 2011 23:45 — forked from devboy/typeParams.as
This is not a language flamewar, Haxe really do looks great and one should use the language he feels the more comfortable with. But I wanted to show how Ruby Duck Typing can handle this kind of situations.
# Ruby is using Duck Typing, rather than checking types, Ruby checks if an object can or cannot respond to a method.
# Here is a "port" of the Haxe example in Ruby.
# Ruby is not a compiled language, so that the "easiest" syntax comes with some shortcoming,
# those errors can only be detected at runtime, your favorite IDE won't warn you before :)
ints = [1, 2, 3]
strings = ["a", "bb", "ccc"]
def biggerThan1(x)
x > 1
@jblanche
jblanche / capitaine.txt
Created November 16, 2011 00:04
Idées Capitaine Train
2 petites idées d'amélioration du site :
Lorsque je ne sais pas exactement à quelle date je vais voyager (ex : retour en famille pour les fêtes, aux dates interchangeables autour de Noël),
j'aimerais pouvoir :
- indiquer au site que je cherche un voyage entre tel et tel jour pour l'aller et entre tel et tel jour pour le retour.
- Une fois l'aller choisi, pouvoir changer la date du retour sans devoir choisir à nouveau un trajet aller.
Cordialement,
@jblanche
jblanche / README.md
Created November 5, 2011 13:43 — forked from mbostock/.block
D3 Show Reel

The first 15 seconds of the D3 show reel. See full video at http://vimeo.com/29862153. Includes seamless transitions between the following visualization types:

  • lines
  • horizons
  • areas
  • stacked areas
  • streamgraph
  • overlapping areas
  • grouped bars
  • stacked bars
@jblanche
jblanche / customField.json
Created October 25, 2011 16:40
locomotive customField
{
"_alias" : "test",
"_id" : ObjectId("4ea6d8038538c6c91f000088"),
"_name" : "custom_field_2",
"_type" : "ContentTypeContentField",
"created_at" : ISODate("2011-10-25T15:38:43Z"),
"hint" : "",
"kind" : "string",
"label" : "name",
"position" : 0,