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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button 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 Account | |
include Mongoid::Document | |
include Mongoid::Timestamps | |
field :subdomain, :type => String | |
embeds_many :users | |
accepts_nested_attributes_for :users | |
validates_presence_of :name, :subdomain | |
validates_uniqueness_of :subdomain, :case_sensitive => false |
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
# First configure your models to use Amazon s3 as storage option and setup the associated S3 config. | |
# Then add the classes your want to migrate in the klasses array below. | |
# Then run rake paperclip_migration:migrate_to_s3 | |
# Should work but this is untested and may need some tweaking - but it did the job for me. | |
namespace :paperclip_migration do | |
desc "migrate files from filesystem to s3" | |
task :migrate_to_s3 => :environment do | |
klasses = [:model_1, :model_2] # Replace with your real model names. If anyone wants to this could be picked up from args or from configuration. | |
klasses.each do |klass_key| |
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
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776 | |
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz | |
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz | |
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz | |
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz |
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
// | |
// Backbone.Rails.js | |
// | |
// Makes Backbone.js play nicely with the default Rails setup, i.e., | |
// no need to set | |
// ActiveRecord::Base.include_root_in_json = false | |
// and build all of your models directly from `params` rather than | |
// `params[:model]`. | |
// | |
// Load this file after backbone.js and before your application JS. |
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
Речь идет о Rails 3.1.0 проекте | |
В Gemfile добавляем все так, как написано в указанном ниже примере Gemfile | |
Версия Spork не менее 0.9.0.rc9 | |
Делаем: | |
bundle install | |
Делаем все необходимые действия для установки RSpec и Cucumber |
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
# -*- coding: utf-8 -*- | |
import sys;reload(sys);sys.setdefaultencoding('utf-8') | |
import twitter | |
import time | |
import commands, itertools | |
consumer_key = ... | |
consumer_secret = ... | |
access_key = ... |
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
# This is a short collection of tools that are useful for managing your | |
# known_hosts file. In this case, I'm using the '-f' flag to specify the | |
# global known_hosts file because I'll be adding many deploy users on this | |
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts | |
# Add entry for host | |
ssh-keyscan -H github.com >> /etc/ssh/ssh_known_hosts | |
# Scan known hosts | |
ssh-keygen -f /etc/ssh/ssh_known_hosts -F github.com |
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
# http://docs.rubygems.org/read/chapter/11 | |
--- | |
gem: --no-ri --no-rdoc | |
benchmark: false | |
verbose: true | |
update_sources: true | |
sources: | |
- http://gems.rubyforge.org/ | |
- http://rubygems.org/ | |
backtrace: true |
OlderNewer