create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Box Shadow</title> | |
<style> | |
.box { | |
height: 150px; | |
width: 300px; | |
margin: 20px; |
ActiveRecord::Base.connection.tables.map do |model| | |
model.capitalize.singularize.camelize | |
end | |
# returns ["Activity", "Article", "User", "Video", "Vote"] |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
//= require jquery | |
//= require jquery_ujs | |
$(function() { | |
var source = new EventSource('/stream'); | |
source.addEventListener('counter', function(e) { | |
$('body').after(e.data + '<br />'); | |
}); | |
}); |
def symbolize_keys(obj) | |
case obj | |
when Array | |
obj.inject([]){|res, val| | |
res << case val | |
when Hash, Array | |
symbolize_keys(val) | |
else | |
val | |
end |
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.
# Main reference was lascarides' post at http://stackoverflow.com/questions/14743447/getting-pdf-from-wickedpdf-for-attachment-via-carrierwave | |
# estimate.rb | |
# ... | |
has_attached_file :pdf, | |
storage: :s3, | |
s3_credentials: { | |
access_key_id: ENV['AWS_ACCESS_KEY_ID'], | |
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'], | |
bucket: ENV['AWS_BUCKET'] |
# config/deploy.rb | |
namespace :upstart do | |
desc 'Generate and upload Upstard configs for daemons needed by the app' | |
task :update_configs, except: {no_release: true} do | |
upstart_config_files = File.expand_path('../upstart/*.conf.erb', __FILE__) | |
upstart_root = '/etc/init' | |
Dir[upstart_config_files].each do |upstart_config_file| | |
config = ERB.new(IO.read(upstart_config_file)).result(binding) |