I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.
Framework | Throughput (req/s) | Latency (ms) | Consistency (σ ms) |
---|
# Simple extension of Net::FTP to allow uploading a stream instead of a file | |
# This allows for transferring of files between servers without downloading entire file first | |
# The code below is a modification of the storbinary method in Net::FTP | |
# https://github.com/ruby/ruby/blob/trunk/lib/net/ftp.rb#L686 | |
# It goes without saying that the code may break at anytime and may or may not work with other | |
# features of Net::FTP such as using Resume. | |
require 'net/ftp' |
# put this file to spec/support/ | |
module RSpec | |
module Core | |
class ExampleGroup | |
def self.Then(*args, &block) | |
args[0] = "Then #{args[0]}" if args[0].is_a?(String) | |
it(*args, &block) | |
end | |
def self.Given(*args, &block) |
I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.
Framework | Throughput (req/s) | Latency (ms) | Consistency (σ ms) |
---|
#encoding: utf-8 | |
require "fileutils" | |
namespace :my_db do desc "Backup project database. Options: DIR=backups RAILS_ENV=production MAX=7" | |
desc "usage - bundle exec rake my_db:backup RAILS_ENV=production MAX=15 DIR=db/db.bak" | |
task :backup => [:environment] do | |
# config base dir | |
datestamp = Time.now.strftime("%Y%m%d%H%M") | |
base_path = Rails.root | |
backup_folder = File.join(base_path, ENV["DIR"] || "backups") | |
FileUtils.mkdir_p(backup_folder) unless File.exist?(backup_folder) |
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
Originally published in June 2008
When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.
To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.
Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.
I have a project where I need translated content. Therefore I use globalize3, wich stores its translated attributes in a seperate table that belongs to the original model. And I use RailsAdmin for painless record management.
It took me some time to figure out how to get those working together, but eventually I found a solution that is non invasive and still ok to work with.
In my case there is a Snippet
class. It holds content for static pages or text passages on the website. There is a good README for globalize3 for installation instructions and documentation.
class ImportController << ApplicationController | |
require 'net/http' | |
require 'net/https' | |
require 'uri' | |
#THIS METHOD TO SEND USER TO THE GOOGLE AUTHENTICATION PAGE. | |
def authenticate | |
# initiate authentication w/ gmail | |
# create url with url-encoded params to initiate connection with contacts api |