Skip to content

Instantly share code, notes, and snippets.

View randallreedjr's full-sized avatar

Randall Reed, Jr. randallreedjr

View GitHub Profile

Prerequisites

Verify latest Ruby version

Ruby downloads

Check local Ruby version (CLI)

$ ruby -v

If necessary, upgrade Ruby (CLI)

$ rvm get stable
@randallreedjr
randallreedjr / heroku-remote.md
Last active February 7, 2024 04:49
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 https://git.heroku.com/staging-app.git
@randallreedjr
randallreedjr / MarkdownComments.md
Last active February 4, 2024 17:36
How to add comments to Markdown

There are comments here but you can't see them

Below this ↓


And above this ↑

@randallreedjr
randallreedjr / .elsintrc.js
Created October 13, 2016 14:50
ESLint config file extending local configuration
module.exports = {
  “extends”: “../src/.eslintrc.js”,
  “rules”: {
  “import/no-extraneous-dependencies”: “error”
  }
};

To copy a Heroku ENV variable from one application to another, from a bash shell, run

heroku config:set MY_VAR="$(heroku config:get MY_VAR --app old-app-name)" --app new-app-name
@randallreedjr
randallreedjr / spec_helper.rb
Created January 30, 2019 18:04
Rspec focus tag by default
# 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
@randallreedjr
randallreedjr / animated-gif.sh
Last active December 30, 2016 02:08
Convert a screen recording to an animated gif
$ ffmpeg -i hello-name-user-data.mov -s 600x400 -pix_fmt rgb24 -r 20 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif
$ ffmpeg -i hello-name-user-data.mov -pix_fmt rgb24 -r 10 out3.gif
@randallreedjr
randallreedjr / highlight.sh
Created December 29, 2016 20:13
Syntax Highlighting for Presentations
$ brew install highlight
$ highlight -w
$ highlight -s anotherdark -O rtf src/HelloWorld.js | pbcopy
/* eslint-disable import/no-extraneous-dependencies */
import { shallow, mount } from ‘enzyme’;
/* eslint-enable import/no-extraneous-dependencies */
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Solarized Color Scheme/Solarized (light).tmTheme",
"fade_fold_buttons": false,
"font_face": "Inconsolata",
"font_size": 16,
"highlight_line": true,
"ignored_packages":
[