Skip to content

Instantly share code, notes, and snippets.

View esparkman's full-sized avatar

Evan Sparkman esparkman

View GitHub Profile
@esparkman
esparkman / heroku-remote.md
Created April 17, 2022 16:45 — forked from randallreedjr/heroku-remote.md
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
@esparkman
esparkman / .irbrc
Created January 6, 2021 16:23
Environment Banners for Rails console + IRB
# .irbrc credit to Matt Swanson @_swanson
# Add color coding based on Rails environment for safety
if defined? Rails
banner = if Rails.env.production?
"\e[41;97;1m #{Rails.env} \e[0m "
else
"\e[42;97;1m #{Rails.env} \e[0m "
end
@esparkman
esparkman / mac-keybindings.json
Created August 15, 2020 03:37
New VS Code Settings
[
// Panels
{ "key": "ctrl+k ctrl+e", "command": "workbench.view.explorer" },
{ "key": "ctrl+k ctrl+g", "command": "workbench.view.scm" },
{ "key": "ctrl+k ctrl+d", "command": "workbench.view.debug" },
{ "key": "ctrl+k ctrl+x", "command": "workbench.extensions.action.showInstalledExtensions" },
{ "key": "ctrl+k ctrl+b", "command": "workbench.action.toggleSidebarVisibility" },
{ "key": "ctrl+e", "command": "workbench.action.focusActiveEditorGroup" },
{ "key": "ctrl+t", "command": "workbench.action.terminal.toggleTerminal" },
{
@esparkman
esparkman / .tmux.conf
Last active February 3, 2020 15:16
Tmuxinator config for Listen360 Ecosystem
###########################
## Configuration
############################
#
# use 256 term for pretty colors
set -g default-terminal "screen-256color"
# increase scroll-back history
set -g history-limit 5000
@esparkman
esparkman / application.html.erb
Created August 19, 2019 21:36
broken example
<!DOCTYPE html>
<html>
<head>
<title>Webbit</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag 'https://fonts.googleapis.com/css?family=IBM+Plex+Sans:400,400i,500,600,700' %>
ourceMap: false, cssnanoOptions: [Object] } },
HashedModuleIdsPlugin {
options:
{ context: null,
hashFunction: 'md4',
hashDigest: 'hex',
hashDigestLength: 4 } },
NamedChunksPlugin { nameResolver: [Function] },
PreloadPlugin {
options:
@esparkman
esparkman / error.txt
Last active May 3, 2019 18:11
netlify build error
Error: ./src/pages/index.js
12:49:02 PM: Module not found: Error: Can't resolve '../components/Layout' in '/opt/build/r epo/src/pages'
12:49:02 PM: resolve '../components/Layout' in '/opt/build/repo/src/pages'
12:49:02 PM: using description file: /opt/build/repo/package.json (relative path: ./src/p ages)
12:49:02 PM: Field 'browser' doesn't contain a valid alias configuration
12:49:02 PM: using description file: /opt/build/repo/package.json (relative path: ./src /components/Layout)
12:49:02 PM: no extension
12:49:02 PM: Field 'browser' doesn't contain a valid alias configuration
12:49:02 PM: /opt/build/repo/src/components/Layout doesn't exist
12:49:02 PM: .mjs

Cheat Sheet: Simple Authentication in Rails 5 with has_secure_password

The goal of this cheatsheet is to make it easy to add hand-rolled authentication to any rails app in a series of layers.

First the simplest/core layers, then optional layers depending on which features/functionality you want.

Specs
AUTHOR Ira Herman
LANGUAGE/STACK Ruby on Rails Version 4 or 5
# /Users/evansparkman/.config/tmuxinator/listen360.yml
name: listen360
root: ~/Listen360/
windows:
- Shell: clear && ls -lah
- DB:
layout: even-horizontal
panes: