Skip to content

Instantly share code, notes, and snippets.

@yannski
yannski / fr.yml
Created April 11, 2011 16:13
different placement of model related translation
fr:
helpers:
select:
prompt: "Veuillez sélectionner"
submit:
create: "Créer un %{model}"
update: "Modifier ce %{model}"
submit: "Enregistrer ce %{model}"
label:
comment:
@yannski
yannski / etl.rake
Created February 5, 2012 16:28
Simple ETL system written with rake
# procedure :
# in development : rake db:restore etl:extract:all db:drop db:create db:migrate etl:load:all
# in production : rake db:backup etl:extract:all db:drop db:create db:migrate etl:load:all
namespace :etl do
namespace :extract do
task :all => :environment do
FileUtils.rm_rf 'db/extracted_data/'
FileUtils.mkdir_p 'db/extracted_data/'
Rake::Task['etl:extract:cities'].invoke
@yannski
yannski / bug_report.txt
Created February 6, 2012 20:28
Procédure de rapport de bug
Comment bien faire un rapport de bug ?
Spécifier un titre et une description.
La description devra répondre aux 3 questions essentielles suivantes :
- quel est le problème en tant que tel ?
- comment reproduire le problème ?
- quel est le comportement attendu ?
En général, il est de bon ton d'ajouter une des informations suivantes :
require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
# require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
@yannski
yannski / edgecamp_welcome.md
Created June 1, 2012 14:15
EdgeCamp welcome text

Alsace Digitale is pleased to welcome the Edgeryders community in Strasbourg by organizing the EdgeCamp, a 2 days BarCamp full of interactivity between the local and remote creative/digital/maker communities.

Under the umbrella of the Council of Europe and the European Commission, the Edgeryders is a community of european youngsters imagining and influencing the futur of Europe using open collaboration techniques.

A BarCamp is an unconference, or user-generated conference, made of open and participatory workshop sessions the content of which is provided by participants. All attendees are encouraged to present or facilitate a session. The principle which governs all Barcamp is : "No spectator, all participants. "

The EdgeCamp will take place saturday 17 and sunday 17 june 2012, at the Centre de Culture Numérique de l'Université de Strasbourg, 16 rue René Descartes 67000 Strasbourg, France.

The event is completely free.

@yannski
yannski / movies.json
Created June 29, 2012 18:20
movies.json
[{"id":"4fede17c312f912796000034","cover_url":null,"description":null,"rating":6.3,"title":"L'affaire Gordji, histoire d'une cohabitation"},{"id":"4fede17f312f912796000035","cover_url":null,"description":"Documentary telling the true story of the sinking of the liner Laconia by a German U-boat in 1942 through the eyes of six survivors.","rating":6.8,"title":"Le naufrage du Laconia - partie 1"},{"id":"4fede181312f912796000036","cover_url":null,"description":"Documentary telling the true story of the sinking of the liner Laconia by a German U-boat in 1942 through the eyes of six survivors.","rating":6.8,"title":"Le naufrage du Laconia - partie 2"},{"id":"4fede184312f912796000037","cover_url":"http://ia.media-imdb.com/images/M/MV5BMjAyMTg0MjgwOV5BMl5BanBnXkFtZTcwNTEzODY4Mw@@._V1._SX94_SY140_.jpg","description":"The extraordinary story of three Rwandan kids who walk 3000 miles to the Soccer World Cup in South Africa...","rating":6.2,"title":"Africa United"},{"id":"4fede186312f912796000038","cover_url":"http://ia.
@yannski
yannski / copy.rb
Created July 4, 2012 08:32
Copy from one Amazon S3 bucket to another with two different accounts
#!/usr/bin/env ruby
require 'rubygems'
require 'right_aws'
# it's possible to copy files from one bucket to another, even it the account is not the same
# in that case, the original file should be public
srcBkt = 'XXX'
destBkt = 'YYY'
@yannski
yannski / mongoid_monkey_patch.rb
Created August 30, 2012 10:19
order results from a mongoid relations according to how they are stored in the relationship array of ids
# place this file in your initializers directory to have a nice to_ordered_a method to be able to retrieve an array ordered according to the order of the *_ids source.
# why doing this ? Because MongoDB allows to store array of objects. An array is not only a nice structure to store ids, it also implies that the ids are stored in a certain order. By default when you call relations in mongoid, the objects are returned in some order (certainly defined by the order of creation), not the order stores in your target array of ids.
module Mongoid #:nodoc:
module Relations #:nodoc:
class Many
def to_ordered_a
original_array_ids = base.send metadata.key.to_sym
original_array_indexes = Hash[original_array_ids.each_with_index.to_a]
target.sort_by{ |s| original_array_indexes[s.id] }
/* Font Awesome
* the iconic font designed for use with Twitter Bootstrap
* -------------------------------------------------------
* The full suite of pictographic icons, examples, and documentation
* can be found at: http://fortawesome.github.com/Font-Awesome/
*
* License
* -------------------------------------------------------
* The Font Awesome webfont, CSS, and LESS files are licensed under CC BY 3.0:
* http://creativecommons.org/licenses/by/3.0/ A mention of
@yannski
yannski / fetedelamusique.xml
Last active December 17, 2015 18:49
Appel à projet open data autour de la fête de la musique de la Ville de Strasbourg (plus d'infos http://www.strasbourg.eu/actualite/-/journal_content/56_INSTANCE_RrL3/10913/336815/10927)
<?xml version="1.0" encoding="utf-8"?>
<lineup xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" lang="fr">
<band url="http://www.myspace.com/monylarry">
<name>Mony</name>
<genre>Pop Rock</genre>
<description>Pour cette 32e édition de la fête de la musique, nous vous invitons à vous exprimer lors de cette grande fête conviviale et populaire.La fête de la musique est la fête de tous les musiciens, à vous de créer la surprise. Sur une scène, un podium, au coin de la rue, à une fenêtre ou depuis votre balcon : le vendredi 21 juin prochain, la musique sera partout.</description>
<picture>
<description>Mony</description>
<url>http://a4.ec-images.myspacecdn.com/images02/63/8a81454a370d43beaefe3175ab6f6aaa/l.jpg</url>
<dimension>