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" },
{
#!/usr/bin/perl
open OUTPUT, ">>output.txt";
open(FILE, $ARGV[0]);
$count = 0;
while($line = <FILE>) {
if ( !($line =~ /^#/ ) ) {
$lines[$count] = $line;
$count++;
}
}
ActiveRecord::Base.establish_connection(
:adapter => "mysql",
:user => "root",
:password => "",
:database => "arvest"
)
class Employee < ActiveRecord::Base
@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
# /Users/evansparkman/.config/tmuxinator/listen360.yml
name: listen360
root: ~/Listen360/
windows:
- Shell: clear && ls -lah
- DB:
layout: even-horizontal
panes:
@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: