Skip to content

Instantly share code, notes, and snippets.

View dpaola2's full-sized avatar

Dave Paola dpaola2

View GitHub Profile
@pat
pat / reading_recommendations.md
Created April 24, 2023 19:53
RailsConf 2023: Upgrading the Ruby Community
@DRBragg
DRBragg / .solargraph.yml
Last active April 25, 2024 21:15
My config with steps to use solargraph for Rails projects in VS Code (WIP)
---
include:
- "app/**/*.rb"
- "config/**/*.rb"
- "lib/**/*.rb"
exclude:
- spec/**/*
- vendor/**/*
- ".bundle/**/*"
require:
@dhairyagabha
dhairyagabha / rails-add-underline-superscript-subscript-to-trix-editor.md
Last active March 25, 2024 23:09
Rails & Trix: Add Underline, Superscript, and Subscript

Rails & Trix: Add Underline, Superscript, and Subscript

This guide will walk you through adding some extra features such as the ability to underline your text, or enhance your content by adding superscripts or subscripts for annotations or Math equations.

Prerequisites: Instruction guide assumes that you have created a Rails application and installed ActionText.

What will you learn:

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@fnky
fnky / stripe-keys-and-ids.tsv
Last active March 29, 2024 22:52
Stripe keys and IDs
Prefix Description Notes
ac_ Platform Client ID Identifier for an auth code/client id.
acct_ Account ID Identifier for an Account object.
aliacc_ Alipay Account ID Identifier for an Alipay account.
ba_ Bank Account ID Identifier for a Bank Account object.
btok_ Bank Token ID Identifier for a Bank Token object.
card_ Card ID Identifier for a Card object.
cbtxn_ Customer Balance Transaction ID Identifier for a Customer Balance Transaction object.
ch_ Charge ID Identifier for a Charge object.
cn_ Credit Note ID Identifier for a Credit Note object.
@lazaronixon
lazaronixon / dropzone_controller.js
Last active March 9, 2024 05:14
Dropzone.js + Stimulus + Active Storage
import { Controller } from "stimulus"
import { DirectUpload } from "@rails/activestorage"
import Dropzone from "dropzone"
import { getMetaValue, findElement, removeElement, insertAfter } from "helpers"
Dropzone.autoDiscover = false
export default class extends Controller {
static targets = [ "input" ]

PEDAC

Objective Step Description
Process the Problem Understand the Problem
  • Identify expected input and output
  • Make the requirements explicit
  • Identify rules
  • Mental model of the problem (optional)
Examples/Test Case Validate understanding of the problem
Data Structure How we represent data that we will work with when converting the input to output.
Algorithm Steps for converting input to output
Code with Intent Code Implementation of Algorithm
@stevenharman
stevenharman / 00_Heroku-Release-Phase-Review-Apps-Rails_README.md
Last active March 11, 2024 04:11
Heroku Release Phase script for managing Rails DB migrations, and playing nice with Review Apps and postdeploy scripts

Heroku Release Phase + Review Apps + Rails

This is a simplified, but fairly thorough, set of scripts and configuration to enable Heroku Release Phase for Rails apps. Further, this particular set up plays nicely with Heroku Review Apps in that the release phase script will:

  1. Fail, loudly, if the DB does not yet exist.
  2. Load the DB schema if the current schema version (as determined by bin/rails db:version) is 0.
  3. Run DB migrations otherwise.

For a "normal" app that usually means it will run the DB migrations.