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
component Dog extends React.Component { | |
render() { | |
const { name } = this.props | |
return ( | |
<div> | |
<h1>{name}</h1> | |
{this.renderPetMeButton()} | |
</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
const mongoose = require('mongoose') | |
const Promise = require('bluebird') | |
mongoose.Promise = Promise | |
const mixinBulkWriteValidation = require('./mixinBulkWriteValidation') | |
mongoose.connect('mongodb://localhost/bulk_update_validation_test', { useMongoClient: true }) | |
const connection = mongoose.connection | |
const Schema = mongoose.Schema |
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 inspect | |
inspection = column_names_with_inspectable_attributes.collect do |attr| | |
...implementation | |
end | |
...return inspection string | |
end | |
def column_names_with_inspectable_attributes | |
column_names.concat(additional_inspectable_attributes) | |
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
--- | |
- hosts: rails | |
remote_user: ubuntu | |
become: yes | |
become_user: root | |
vars: | |
secret_key_base: '{{ SECRET_KEY_BASE }}' | |
secret_token: '{{ SECRET_TOKEN }}' | |
db_username: '{{ DB_USERNAME }}' |
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_programatically | |
# User or whatever the name of the model is that you're trying to authenticate | |
@request.env['devise.mapping'] = Devise.mappings[:user] | |
@resource = FactoryGirl.create(:confirmed_user) | |
# The following two lines are where the magic happens. | |
@auth_headers = @resource.create_new_auth_token | |
@request.headers.merge!(@auth_headers) | |
end |