This file contains 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
Hi, | |
My name is Charles Bernoskie and I noticed that XYZ Corp is looking | |
for a LAMP developer. Many of the qualifications you are looking for in a | |
developer (e.g. PHP, Python, MySQL, Java) are identical to those of a | |
daily Stack Overflow user. | |
Stack Overflow is the largest programming community(Over 20mm visitors | |
per month) with the fastest growing career section for developers on the | |
internet. We offer a satisfaction guarantee. If you are not completely |
This file contains 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
# app/views/posts/new.html.erb | |
<%= form_for(Post.new) do |form| %> | |
Title: <%= form.text_field :title %> | |
Body: <%= form.text_field :body %> | |
<% end %> | |
...would produce a signature field that can be used to automatically untaint: | |
<input type="hidden" name="signature" value="...."> |
This file contains 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
class PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
end | |
private |
This file contains 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
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 file contains 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
Hi David, | |
I came across your profile online and wanted to reach out about Development | |
Opportunities here at Groupon. The company is growing, and we're always | |
looking for folks with solid skills that can make positive contribution to | |
our continued success. Any chance you'd be open to a quick conversation | |
about opportunities, or for any possible networking potential? If so, let me | |
know when you're free and we can set up a time to chat. Also, if you are | |
interested, it would be great if you could forward a current resume over | |
that I can take a look at. I look forward to hearing back from you! Please | |
let me know if you have any questions. |
This file contains 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 revoke(user) | |
proxy_association.owner.tap do |project| | |
# You can't remove the last user with access (someone has to have access to the project!) | |
if project.users.many? | |
if user.pending? && user.projects.one? | |
user.destroy | |
else | |
project.users.delete(user) | |
user.touch | |
end |
This file contains 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
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |
This file contains 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
# Bulk API design | |
# | |
# resources :posts | |
class PostsController < ActiveController::Base | |
# GET /posts/1,4,50,90 | |
# post_url([ @post, @post ]) | |
def show_many | |
@posts = Post.find(params[:ids]) | |
end |
This file contains 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
Designers need fleshed out pages to do properly design a screen. | |
In the past, we've loaded test fixtures in development to give them that. | |
But test fixtures are not a good fit for this. | |
They're designed to make testing easy, not designing. | |
What we need instead is a way for a designer to create a dataset | |
that'll work great for design and then save that as a snapshot. | |
This snapshot can be named and reloaded as often as desired. | |
I envision it'll work like this: |
This file contains 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
class NotesController < ApplicationController | |
def create | |
@note = @project.notes.create params[:note].merge( | |
creator: current_user, subscribers: extract_subscribers(params[:note])) | |
@note.subscribers.each { |subscriber| Subscriptions.note(@note, subscriber).deliver } | |
end | |
end | |
class Subscriptions < ActionMailer::Base |