Get it from the App Store.
In XCode's Preferences > Downloads you can install command line tools.
# place in config/initalizers | |
module ActiveRecord | |
class Base | |
# Establishes a connection to the database that's used by all Active Record objects. | |
def self.mysql2_connection(config) | |
config[:username] = 'root' if config[:username].nil? | |
if Mysql2::Client.const_defined? :FOUND_ROWS | |
config[:flags] = Mysql2::Client::FOUND_ROWS | Mysql2::Client::MULTI_STATEMENTS |
Hi David, | |
My name is Jeff Morse. I'm a Recruiter at a super-charged start-up called Mixbook www.mixbook.com I came across your profile on workingwithrails and have a full-time Sr. Ruby on Rails opening working onsite in our Palo Alto, California office that is a great match for your background/experience. Would you be ready to make the move to Silicon Valley, the most innovative place for web start ups which offers superior growth opportunities for talented ruby developers like yourself? Mixbook will pay for all relocation costs. | |
Would you be open to taking a phone/Sykpe call from our CTO, Aryk Grosz (see attached LinkedIn profile) to discuss the position further? If interested, email me your Skype ID and I’ll coordinate the call with Aryk. | |
Cheers, | |
Jeff Morse | |
Sr. Recruiter |
--- | |
#### | |
#### THIS IS OLD AND OUTDATED | |
#### LIKE, ANSIBLE 1.0 OLD. | |
#### | |
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES | |
#### | |
#### IF IT BREAKS I'M JUST SOME GUY WITH | |
#### A DOG, OK, SORRY | |
#### |
# Show red environment name in pry prompt for non development environments | |
old_prompt = Pry.config.prompt | |
Pry.config.prompt = [ | |
proc {|a,b,c| "\001\e[31m\002#{(Rails.env.upcase)}\001\e[0m\002 #{old_prompt.first.call(a,b,c)}"}, | |
proc {|a,b,c| "\001\e[31m\002#{(Rails.env.upcase)}\001\e[0m\002 #{old_prompt.second.call(a,b,c)}"}, | |
] unless Rails.env.development? |
# | |
# ruby pi - how to calculate pi with ruby. | |
# proving that pi is the limit of this series: | |
# 4/1 - 4/3 + 4/5 - 4/7 + 4/9 ... | |
# | |
num = 4.0 | |
pi = 0 | |
plus = true | |
den = 1 |
BEFORE: | |
sam@ubuntu discourse % rm -fr tmp/cache | |
sam@ubuntu discourse % rm -fr public/assets | |
sam@ubuntu discourse % time RAILS_ENV=production bin/rake assets:precompile | |
58.55s user 1.79s system 100% cpu 1:00.02 total | |
AFTER: |
HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |
NOTE: Please send your answers to [email protected] rather than post them publicly in another Gist or in comments on this Gist.
Each voter can vote in zero or more referenda. Each referendum has one or more questions, and each question is a yes/no vote. Write the simplest normalized schema to describe this in generic SQL statements or as an entity-relationship diagram. Point out where the indexes would be if you want to quickly know the results of a given referendum question, but you never expect to query a single voter's voting record.
Your client plans to host their web application on AWS. When would you advise (a) deployment in a single availability zone, (b) deployment in multiple availability zones in a single region (c) deployment in multiple regions? What operational difficulty or complexity, if any, is added as you go from (a) to (b) to (c)?