Skip to content

Instantly share code, notes, and snippets.

Randall Reed, Jr. randallreedjr

Block or report user

Report or block randallreedjr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
randallreedjr /
Last active Jun 20, 2019
How to add comments to Markdown

There are comments here but you can't see them

Below this ↓

And above this ↑

randallreedjr / spec_helper.rb
Created Jan 30, 2019
Rspec focus tag by default
View spec_helper.rb
# These two settings work together to allow you to limit a spec run
# to individual examples or groups you care about by tagging them with
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
# get run.
config.filter_run :focus
config.run_all_when_everything_filtered = true


$ rails new my-app

With rspec (no tests)

$ rails new my-app -T
# gem 'rspec-rails'
$ bundle install
randallreedjr /
Last active Dec 3, 2019
Add a Heroku remote to an existing git repo

Working with git remotes on Heroku

Generally, you will add a git remote for your Heroku app during the Heroku app creation process, i.e. heroku create. However, if you are working on an existing app and want to add git remotes to enable manual deploys, the following commands may be useful.

Adding a new remote

Add a remote for your Staging app and deploy

Note that on Heroku, you must always use master as the destination branch on the remote. If you want to deploy a different branch, you can use the syntax local_branch:destination_branch seen below (in this example, we push the local staging branch to the master branch on heroku.

$ git remote add staging
randallreedjr /
Last active Dec 30, 2016
Convert a screen recording to an animated gif
$ ffmpeg -i -s 600x400 -pix_fmt rgb24 -r 20 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif
$ ffmpeg -i -pix_fmt rgb24 -r 10 out3.gif
randallreedjr /
Created Dec 29, 2016
Syntax Highlighting for Presentations
$ brew install highlight
$ highlight -w
$ highlight -s anotherdark -O rtf src/HelloWorld.js | pbcopy
View example_spec.js
/* eslint-disable import/no-extraneous-dependencies */
import { shallow, mount } from ‘enzyme’;
/* eslint-enable import/no-extraneous-dependencies */
randallreedjr / .elsintrc.js
Created Oct 13, 2016
ESLint config file extending local configuration
View .elsintrc.js
module.exports = {
  “extends: “../src/.eslintrc.js”,
  “rules”: {
  “import/no-extraneous-dependencies”: “error”
randallreedjr / replaceText.js
Last active May 18, 2016
Javascript string replace
View replaceText.js
replaceText = function(string, oldText, newText) {
index = string.indexOf(oldText);
front = string.substring(0, index);
back = string.substring(index + oldText.length);
return front + newText + back;
replaceTextGlobal = function(string, oldText, newText) {
while(string.indexOf(oldText) >= 0) {
string = replaceText(string, oldText, newText);
randallreedjr /
Last active Apr 19, 2016
Useful options when generating a Rails engine
rails plugin new -OJT --skip-bundle --mountable --dummy-path spec/dummy
OJT prevents assets and test unit files being generated,
skip bundle because you're going to be adding rspec
--dummy-path because that's where rspec will live
You can’t perform that action at this time.