This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'uri' | |
| namespace :mongo do | |
| desc "Dump the production database and restore to development and staging databases." | |
| task :dump_and_restore => :environment do | |
| dev = URI.parse(ENV["MONGO_URI"]) | |
| prod = URI.parse(`heroku config:get MONGO_URI --remote production`) | |
| prod_username, prod_password = prod.userinfo.split(':') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dmp = DiffMatchPatch.new | |
| t1 = "Le ciel est bleu et le soleil brille." | |
| t2 = "Il pleut sur la ville et le soleil ne brille pas." | |
| diffs = dmp.diff_main(t1, t2) | |
| dmp.diff_cleanupSemantic(diffs) | |
| patchs = dmp.patch_make(t1, diffs) | |
| dmp.patch_apply([patchs.first], t1) | |
| # => ["Il pleut sur la ville et le soleil brille.", [true]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rss-crons [master●] % gem install curb | |
| Fetching: curb-0.8.0.gem (100%) | |
| Building native extensions. This could take a while... | |
| ERROR: Error installing curb: | |
| ERROR: Failed to build gem native extension. | |
| /home/sebastien/.rbenv/versions/1.9.3-p0/bin/ruby extconf.rb | |
| checking for curl-config... no | |
| checking for main() in -lcurl... no | |
| *** extconf.rb failed *** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Post | |
| include Mongoid::Document | |
| embeds_many :comments | |
| end | |
| class Comment | |
| include Mongoid::Document | |
| field :content | |
| embedded_in :post | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fr: | |
| errors: | |
| messages: | |
| not_found: "n'a pas été trouvé(e)" | |
| already_confirmed: "a déjà été validé(e)" | |
| not_locked: "n'était pas verrouillé(e)" | |
| not_saved: | |
| one: "1 erreur a empêché ce(tte) %{resource} d'être sauvegardé(e) :" | |
| other: "%{count} erreurs ont empêché ce(tte) %{resource} d'être sauvegardé(e) :" | |
| devise: |