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 'rubygems' | |
| require 'bundler/setup' | |
| require 'pry-byebug' | |
| puts "test1" | |
| binding.pry |
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
| $:.unshift File.expand_path("../../lib", File.dirname(__FILE__)) | |
| require 'rubygems' | |
| require 'bundler/setup' | |
| require 'lob' | |
| require 'csv' | |
| require 'pry-byebug' | |
| binding.pry |
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 'rubygems' | |
| require 'bundler/setup' | |
| require 'pry-byebug' | |
| hash = { | |
| :text_data => "data", | |
| :name => "name", | |
| :from_address_select => "name from address slect", | |
| :from_name => "name from name ", | |
| :from_line1 => "name from line 1 ", |
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
| hash = { | |
| :text_data => "data", | |
| :name => "name", | |
| :from_address_select => "name from address slect", | |
| :from_name => "name from name ", | |
| :from_line1 => "name from line 1 ", | |
| :from_line2 => "name from line 2", | |
| :from_city_name => "name city name " , | |
| :from_state_name => "name from state name", |
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
| hash = { | |
| :text_data => "data", | |
| :name => "name", | |
| :from_address_select => " name from address slect", | |
| :from_name => "name from name ", | |
| :from_line1 => "name from line 1 ", | |
| :from_line2 => "name from line 2 ", | |
| :from_city_name => "name city name " , | |
| :from_state_name => "name from state name ", | |
| :from_zip => "name from zip", |
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
| def save_post_card | |
| binding.pry | |
| card = PostCard.where(:id => params[:post_card_id]).first | |
| if card.nil? | |
| render text: 'Nnot found postcard with provided ID', status: 404 | |
| return | |
| end | |
| text_data = params[:text_data] | |
| name = params[:name].strip |
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
| create_table "post_cards", force: :cascade do |t| | |
| t.string "name" | |
| t.integer "user_id" | |
| t.integer "design_id" | |
| t.text "message" | |
| t.integer "from_address_id" | |
| t.integer "to_address_id" | |
| t.integer "status" | |
| t.decimal "price", precision: 12, scale: 2 | |
| t.datetime "created_at", null: false |
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
| 28: def process_action(*args) | |
| 29: super | |
| 30: rescue Exception => exception | |
| 31: request.env['action_dispatch.show_detailed_exceptions'] ||= show_detailed_exceptions? | |
| => 32: rescue_with_handler(exception) || raise(exception) | |
| 33: 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
| ef get_front_side (post_card) | |
| @post_card = post_card | |
| @msg = JSON.parse(@post_card.message) | |
| @msg['front_side']['texts'].each do |text| | |
| text['bg_color_rgba'] = 'rgba(255,255,255,'+(text['opacity'].to_f/100.0).to_s+')'; | |
| end | |
| fonts_list = [] |
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' | |
| n = 5000 | |
| h = "test" | |
| salt = SecureRandom.random_bytes(64) | |
| key = ActiveSupport::KeyGenerator.new('password').generate_key(salt) | |
| Benchmark.bm do |x| | |
| x.report("dbrequest:") do | |
| n.times do |
OlderNewer