start new:
tmux
start new with session name:
tmux new -s myname
| # delete local tag '12345' | |
| git tag -d 12345 | |
| # delete remote tag '12345' (eg, GitHub version too) | |
| git push origin :refs/tags/12345 | |
| # alternative approach | |
| git push --delete origin tagName | |
| git tag -d tagName |
| import React, { PropTypes, Component } from 'react'; | |
| class $NAME extends Component { | |
| render() { | |
| return ( | |
| ); | |
| } | |
| } |
| import React, { PropTypes } from 'react'; | |
| const $NAME = (props) => { | |
| return ( | |
| $END | |
| ); | |
| } | |
| $NAME.propTypes = { | |
| // myProp: PropTypes.string.isRequired |
| import React, { PropTypes, Component } from 'react'; | |
| import { connect } from 'react-redux'; | |
| import { bindActionCreators } from 'redux'; | |
| // Import actions here!! | |
| class $NAME extends Component { | |
| constructor(props, context) { | |
| super(props, context); | |
| } |
| =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') |
| #Deploy and rollback on Heroku in staging, production, dev and test environments | |
| require 'tempfile' | |
| # for capturing error in 'git push' | |
| def capture_stderr | |
| stderr = $stderr.dup | |
| Tempfile.open 'stderr-redirect' do |temp| | |
| $stderr.reopen temp.path, 'w+' | |
| yield if block_given? |
| # Deploy and rollback script for Heroku on staging and/or production | |
| # Modified from: https://gist.github.com/njvitto/362873 | |
| namespace :deploy do | |
| PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU' | |
| STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU' | |
| desc 'Deploy to Staging on Heroku' | |
| task :staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
| desc 'Deploy to Production on Heroku' |
| # An abstract base class used to create simple serializers | |
| # for ActiveRecord objects | |
| class BaseSerializer | |
| include Rails.application.routes.url_helpers | |
| attr_reader :serialized_object | |
| def initialize(serialized_object) | |
| @serialized_object = serialized_object | |
| end |