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 / setup_bark_wsl.sh
Last active May 2, 2023 04:51
Setup bark on WSL
#!/bin/zsh
# requires Nvidia GPU
# Update package list
sudo apt update
# Remove Outdated Signing Key
sudo apt-key del 7fa2af80
@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 / shrine.rb
Created July 24, 2021 19:20
Attempt to have both Public and Private Shrine Storages
# frozen_string_literal: true
require "shrine"
require "shrine/storage/s3"
s3_options = {
access_key_id: ENV["AWS_ACCESS_KEY"],
secret_access_key: ENV["AWS_SECRET_KEY"],
endpoint: ENV["AWS_ENDPOINT"],
region: ENV["AWS_REGION"],
require 'data-anonymization'
DataAnon::Utils::Logging.logger.level = Logger::INFO
class MyRandomEmail
TLDS = ['com','org','net','edu','gov','mil','biz','info', 'io']
HOSTNAMES = ['google', 'outlook', 'hotmail']
def initialize hostname = nil, tld = nil
@hostname = hostname
@tld = tld
version: '2'
services:
mauticdb:
image: percona/percona-server:5.7
container_name: mauticdb
volumes:
- mysql_data:/var/lib/mysql
environment:
@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