Original command | docker-compose command |
---|---|
rails c |
docker-compose run web rails c |
RAILS_ENV=test rake db:create |
docker-compose run -e RAILS_ENV=test web rake db:create |
rspec spec/path/to/spec.rb |
docker-compose run web rspec spec/path/to/spec.rb |
bundle install |
docker-compose run web bundle install |
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
// Defining the component | |
const ProfilePage = ({ username, numPosts, numComments }) => | |
<main> | |
<h1>{username}</h1> | |
<span>{numPosts} Posts</span> | |
<span>{numComments} Comments</span> | |
</main> | |
ProfilePage.propTypes = { | |
username: PropTypes.string.isRequired, |
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 Article < ActiveRecord::Base | |
# all the other logic | |
def associated_articles | |
Article.where.not(id: id).where('tags && ARRAY[?]', tags) | |
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
[playground] | |
aws_access_key_id = 13ABCHHASDBYB2U3NG34NG | |
aws_secret_access_key = nfu8n3787N4F874GN8n7g847878G87NG/GUNREIN |
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
@connect(...) | |
class HomePage extends React.Component { | |
handleContactFormSubmission (e) { | |
e.preventDefault() | |
const formData = { ... } | |
this.props.dispatch(submitContactForm(formData)) | |
} | |
render () { | |
return ( |
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
{ type: 'ADD_COMMENT', comment: { body: 'test comment', user: 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
<link rel="import" href="/components/gallery.html"> | |
<gallery /> |
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
<Comment props={{ username: 'richard', comment: 'React!' }} /> |
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 Comment { | |
styles = { | |
username: { | |
fontWeight: 'bold', | |
paddingRight: '10px', | |
}, | |
comment: { | |
color: '#444', | |
}, | |
}; |
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
<template name="gallery"> | |
<style> | |
section { | |
padding: 10px; | |
background: #333; | |
} | |
.images img { | |
display: none; | |
} |
NewerOlder