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 "yaml" | |
require "bundler/inline" | |
gemfile do | |
source "https://rubygems.org" | |
gem "faker" | |
end | |
items = [] | |
categories = 10.times.map { Faker::Company.industry } |
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 'benchmark/ips' | |
require 'mini_i18n' | |
require 'i18n' | |
translations_path = File.expand_path('./spec/fixtures/locales/*') | |
# Init MiniI18n | |
MiniI18n.load_translations(translations_path) | |
# Init I18n |
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
namespace :attachments do | |
task migrate_to_s3: :environment do | |
require 'aws-sdk' | |
# Define Paperclip models | |
models = [ | |
[Attachment, :data], | |
[Image, :data], | |
[MediaAppearance, :media_logo], | |
[Testimonial, :avatar_logo] |
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
# Publish messages to Hipchat https://www.hipchat.com | |
def publish_to_hipchat(room_id, msg, from, format, color, auth_token) | |
`curl -X POST -d "room_id=#{room_id}&message=#{msg}&from=#{from}&message_format=#{format}&color=#{color}" \ | |
"https://api.hipchat.com/v1/rooms/message?auth_token=#{auth_token}"` | |
end | |
# Publish messages to Talker http://talkerapp.com | |
def publish_to_talker(room_id, msg, auth_token) | |
`curl -H 'Accept: application/json' -H 'Content-Type: application/json' \ | |
-H 'X-Talker-Token: "#{auth_token}"' \ |
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
$ rvm get latest | |
$ rvm pkg install readline | |
$ rvm reinstall 1.9.3-p327 --with-readline-dir=$rvm_path/usr |