Skip to content

Instantly share code, notes, and snippets.

View aurels's full-sized avatar

Aurélien Malisart aurels

View GitHub Profile
genealogy[master]: bundle exec rake
/Users/aurels/.rbenv/versions/1.9.3-p448/bin/ruby -I/Users/aurels/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rspec-core-3.0.3/lib:/Users/aurels/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rspec-support-3.0.3/lib -S /Users/aurels/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rspec-core-3.0.3/exe/rspec ./spec/genealogy/alter_current_spouse_spec.rb ./spec/genealogy/alter_grandparents_spec.rb ./spec/genealogy/alter_offspring_spec.rb ./spec/genealogy/alter_parents_spec.rb ./spec/genealogy/alter_siblings_spec.rb ./spec/genealogy/model_lifecycle_spec.rb ./spec/genealogy/model_settings_spec.rb ./spec/genealogy/query_methods_spec.rb --format documentation --color
/Users/aurels/Dev/genealogy/spec/genealogy/alter_current_spouse_spec.rb:23:in `block (4 levels) in <module:AlterCurrentSpouseSpec>': undefined method `its' for #<Class:0x007fc954f27428> (NoMethodError)
from /Users/aurels/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rspec-core-3.0.3/lib/rspec/c
irb(main):008:0> Video.find(4247).automatic_youtube_tags
=> ["« Mais pourquoi donc / Sept étoiles » - Auberson, Bovard, Big Band de Lausanne - Montreux Jazz F...", "Mais", "pourquoi", "donc", "Sept", "étoiles", "Auberson,", "Bovard,", "Big", "Band", "de", "Lausanne", "Montreux", "Jazz", "F...", "Mais pourquoi donc / Sept étoiles", "Pascal Auberson", "Pascal", "Auberson", "Jean-François Bovard", "Jean-François", "Bovard", "Le Big Band de Lausanne", "Le"]
def draw_circle(x, y, size, color)
goto x, y
pencolor color
for i in (1..360)
forward size
turnright 1
end
end
<div class="input short">
<%= data_f.label :number_format, _("Style de formatage des nombres") %>
<%= data_f.select :number_format, NumberFormat.options_for_select %>
</div>
<div class="input short">
<%= data_f.label :date_format, _("Style de formatage des dates") %>
<%= data_f.select :date_format, DateFormat.options_for_select %>
</div>
var segments = Immutable.List()
undefined
segments
Object {size: 0, _origin: 0, _capacity: 0, _level: 5, _root: undefined…}
segments.push({id: 1, name: "Un"})
Object {size: 1, _origin: 0, _capacity: 1, _level: 5, _root: null…}
segments.push({id: 1, name: "Un"}).size
# Create a mysql user and give him all rights on a given database
$ mysql -u root -p
GRANT SELECT, LOCK TABLES, INDEX, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP ON specific_database.* TO 'brand_new_user'@localhost IDENTIFIED BY 'awsome_password';
FLUSH PRIVILEGES;
# To improve
# Make an SSH tunnel
$ ssh remotehost.com -L X/localhost/Y
Where:
- X is the local port
- Y is the remote port
# Push a DB to Heroku with UTF8 encoding
heroku db:push mysql://root@localhost/my_db_name?encoding=utf8
# Building UML graphs with railroad for Rails
lib/tasks/uml.rake
namespace :uml do
desc 'Builds UML graphs for the project'
task :build do
`railroad -M | dot -Tpng > models.png`
`railroad -C | dot -Tpng > controllers.png`
end
# Install the MySQL gem on Snow Leopard
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config