Skip to content

Instantly share code, notes, and snippets.

View petebytes's full-sized avatar

petebytes petebytes

  • Apsion
  • Fountain Hills, AZ
View GitHub Profile
@petebytes
petebytes / Pghero on Rails with Dokku.txt
Created January 16, 2023 16:39 — forked from monsha/Pghero on Rails with Dokku.txt
Pghero on Rails with Dokku
#postgresql setup
ssh -i ~/.ssh/id_rsa root@<domain>
dokku postgres:connect <db>
psql=# SHOW config_file;
-> /var/lib/postgresql/data/postgresql.conf
psql=# \q
docker ps
@petebytes
petebytes / byebug_commands.md
Created August 22, 2021 04:31 — forked from elrayle/byebug_commands.md
Byebug Cheatsheet - organized by related commands

Byebug Cheatsheet

This cheatsheet includes most of the byebug commands organized by related commands (e.g. breakpoint related commands are together).

To see official help...

Command Aliases Example Comments
help h h list top level of all commands
help cmd h cmd-alias h n list the details of a command (example shows requesting details for the next command) (this works for all commands)
@petebytes
petebytes / _photo.json.jbuilder
Created October 20, 2019 18:24 — forked from TheRealNeil/_photo.json.jbuilder
Using the Trix Editor plus Private File Upload Attachments to S3
json.extract! photo, :id, :image_data, :created_at, :updated_at
json.url photo_url(photo, format: :html)
json.image_url image_url_photo_url(photo)
@petebytes
petebytes / dropzone_controller.js
Created October 10, 2019 06:10 — forked from lazaronixon/dropzone_controller.js
Dropzone.js + Stimulus + Active Storage
import { Controller } from "stimulus"
import { DirectUpload } from "@rails/activestorage"
import { getMetaValue, toArray, findElement, removeElement, insertAfter } from "helpers"
export default class extends Controller {
static targets = [ "input" ]
connect() {
this.dropZone = createDropZone(this)
this.hideFileInput()

Dropping Migration Table, Models, Controller

Command Line

1. Drop Table/Migration

rails generate migration DropTablename

A file will be created, in the db > migrate folder, make sure it looks like:

@petebytes
petebytes / Dokku v0.5.6 Rails App.md
Created April 22, 2019 18:36 — forked from Epigene/Dokku v0.5.6 Rails App.md
Knowledge-Base for getting a Rails5 app with Cable running on dokku v0.5.6

Dokku v0.5.6 Rails workflow

Straight to Maintenance

0. Set up Droplet

Initialize the droplet with dokku app pre-setup
@petebytes
petebytes / .gitignore
Created April 17, 2019 19:39 — forked from salcode/.gitignore
.gitignore file for a general web project - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20181206
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/10017553/raw/.gitignore
# to download this file
#
;#NoTrayIcon
;#SingleInstance force
;#Persistent
;#InstallKeybdHook
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Logitech T650 mappings for Windows 10.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;