gpf='git push --force-with-lease'
gca='git commit -v -a'
gpthis='git push origin HEAD:$(git_current_branch) && git branch -u origin/$(git_current_branch) $(git_current_branch) && echo "pushed current branch and set upstream to origin"'
gco='git checkout'
g='grep -i --color=auto'
hb='hub browse'
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
# Using these pry gems -- copy to your Gemfile | |
# group :development, :test do | |
# gem 'awesome_print' # pretty print ruby objects | |
# gem 'pry' # Console with powerful introspection capabilities | |
# # pick either: | |
# # using byebug, but has issues with Zeitwerk | |
# gem 'pry-byebug' # Integrates pry with byebug | |
# | |
# # using default ruby debuggger | |
# gem 'pry-stack_explorer' |
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
# Using these pry gems -- copy to your Gemfile | |
# group :development, :test do | |
# gem 'awesome_print' # pretty print ruby objects | |
# gem 'pry' # Console with powerful introspection capabilities | |
# # pick either: | |
# # using byebug, but has issues with Zeitwerk | |
# gem 'pry-byebug' # Integrates pry with byebug | |
# | |
# # using default ruby debuggger | |
# gem 'pry-stack_explorer' |
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
#!/usr/bin/env bash | |
# Edit the list of commands. | |
# YOU MUST USE SINGLE QUOTES HERE. | |
commands=( | |
'yarn run build:client-bundles:prod' | |
'yarn run build:server-bundle:prod' | |
'yarn run build:global-styles:prod' | |
) |
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
######################################################################################################################## | |
######################################################################################################################## | |
# run-prod-locally.sh | |
######################################################################################################################## | |
echo "Only run this once to set your production setup after changing JS assets." | |
echo "You can run foreman start -f Procfile.local-prod to restart the server without recompiling" | |
echo "You may want to have your /application.yml and /config/database.yml reflect your development settings for production" | |
# Run the rake tasks as production | |
RAILS_ENV=production rake assets:clobber |
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
////////////////////////////////////////////////////////////////////////////////////////////// | |
////////////////////////////////////////////////////////////////////////////////////////////// | |
// app/bundles/HelloWorld/actions/helloWorldActionCreators.jsx | |
import { HELLO_WORLD_NAME_UPDATE } from '../constants/helloWorldConstants'; | |
export const updateName = (text) => ({ | |
type: HELLO_WORLD_NAME_UPDATE, | |
text, | |
}); |
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
// multiple entities returned gets normalized | |
// https://github.com/shakacode/react-webpack-rails-tutorial/blob/08081f07c7d2686facf2e98d956d50dfbef83678/mobile/ReactNativeTutorial/app/api/index.js | |
export const fetchComments = async () => { | |
const response = await getRequest('comments.json'); | |
const camelizedResponse = _.mapKeys(_.camelCase, response); | |
const { entities } = normalize(camelizedResponse, { comments: commentsSchema }); | |
return entities; | |
}; |
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
# See in use here: | |
# https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/spec/support/poltergeist.rb | |
# This file supports 2 strategies: | |
# 1. switch_to_selenium: switch drivers | |
# 2. restart_poltergeist | |
RESTART_PHANTOMJS = ENV["RESTART_PHANTOMJS"] && | |
%w(TRUE YES).include?(ENV["RESTART_PHANTOMJS"].upcase) | |
puts "RESTART_PHANTOMJS = #{RESTART_PHANTOMJS}" |
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
➜ ~/shakacode/react-webpack-rails-tutorial (fix-comments-json-format) DRIVER=selenium_chrome rspec [12:06:38] | |
Running via Spring preloader in process 39408 | |
[Coveralls] Set up the SimpleCov formatter. | |
[Coveralls] Using SimpleCov's 'rails' settings. | |
Capybara using driver: selenium_chrome | |
Add new comment | |
from main page | |
via Horizontal Form | |
when the new comment is submitted |
NewerOlder