Skip to content

Instantly share code, notes, and snippets.

View basuneko's full-sized avatar

Constantine Zaytsev basuneko

  • OnSend
  • Auckland, New Zealand
View GitHub Profile
@basuneko
basuneko / ruby_on_rails_deployment.md
Created August 13, 2019 08:43 — forked from zentetsukenz/ruby_on_rails_deployment.md
Deploy Ruby on Rails application with Docker Compose and Capistrano with ease

#Docker

##Files and Folders.

|
|\_ app
|...
|\_ docker
| |
@basuneko
basuneko / gist:1162627
Created August 22, 2011 15:17
spreadsheet bug
price = params[:price]
File.open(Rails.root.join('tmp', 'price.xls'), 'wb') do |file|
file.write(price.read)
end
book = Spreadsheet.open "#{Rails.root}/tmp/price.xls"
sheet = book.worksheet 0
sheet.each do |row| #this rows throws the "Called id for nil, which would mistakenly be 4..." error
@basuneko
basuneko / gist:1008050
Created June 4, 2011 16:49
Parsing a .xls price list with several categories using Spreadsheet gem
def create
require 'spreadsheet'
#for debugging purposes the file path is hardcoded
book = Spreadsheet.open "#{Rails.root}/public/price.xls"
sheet = book.worksheet 0
sheet.each do |row|
font = row.format(0).font # read font data of the first cell in the row