Find this post at URL
This file contains hidden or 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 login(user=nil) | |
| u = user || create(:user) | |
| visit new_user_session_path | |
| within("#new_user") do | |
| fill_in 'Email', :with => u.email | |
| fill_in 'Password', :with => '12345678' | |
| click_button 'Log in' | |
| end | |
| end |
This file contains hidden or 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
| <!-- Begin MailChimp Signup Form --> | |
| <div id="mc_embed_signup"> | |
| <form action="http://itsbspoke.us2.list-manage.com/subscribe/post?u=8b4656bd4a093a3bcabfda08a&id=4f80c66e83" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate> | |
| <div class="mc-field-group"> | |
| <label for="mce-EMAIL">Email Address </label> | |
| <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL"> | |
| </div> | |
| <div id="mce-responses" class="clear"> | |
| <div class="response" id="mce-error-response" style="display:none"></div> |
This file contains hidden or 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
| - include: dot-env.yml | |
| - include: capistrano.yml | |
| - include: bundle.yml | |
| when: $bundle | |
| - include: db.yml | |
| - include: unicorn.yml | |
| when: $unicorn | |
| - include: foreman.yml | |
| when: $foreman | |
| - include: nginx.yml |
This file contains hidden or 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 FacebookInterface | |
| def self.for(user) | |
| auth = user.authentications.where(provider: "facebook").first | |
| return if auth.nil? | |
| return if auth.oauth_token.nil? | |
| FacebookInterface.new(Koala::Facebook::API.new(auth.oauth_token)) | |
| end | |
| def initialize(api) | |
| @api = api |
This file contains hidden or 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 CreateAuthentications < ActiveRecord::Migration | |
| def change | |
| create_table :authentications do |t| | |
| t.integer :user_id | |
| t.string :provider | |
| t.string :uid | |
| t.string :name | |
| t.string :oauth_token | |
| t.datetime :oauth_expires_at |
This file contains hidden or 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
| development: | |
| adapter: postgresql | |
| encoding: unicode | |
| database: app_development | |
| pool: 5 | |
| # Connect on a TCP socket. Omitted by default since the client uses a | |
| # domain socket that doesn't need configuration. Windows does not have | |
| # domain sockets, so uncomment these lines. | |
| #host: localhost |
This file contains hidden or 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 -*- | |
| require 'fileutils' | |
| require 'date' | |
| require 'yaml' | |
| require 'uri' | |
| require 'rexml/document' | |
| include REXML | |
| doc = Document.new File.new(ARGV[0]) |
This file contains hidden or 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
| mike@rbci:~$ psql -U postgres | |
| psql (9.0.3) | |
| Type "help" for help. | |
| postgres=# update pg_database set datallowconn = TRUE where datname = 'template0'; | |
| UPDATE 1 | |
| postgres=# \c template0 | |
| You are now connected to database "template0". | |
| template0=# update pg_database set datistemplate = FALSE where datname = 'template1'; | |
| UPDATE 1 |
This file contains hidden or 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
| grammar Querying | |
| rule statement | |
| (compound_predicate | predicate) | |
| end | |
| rule compound_predicate | |
| (predicate space* operator_and_predicate){ | |
| Wither::CompoundPredicate.new(predicate.value, | |
| operator_and_predicate.group_operator.value, |