Skip to content

Instantly share code, notes, and snippets.

View rossta's full-sized avatar
💭
Being curious

Ross Kaffenberger rossta

💭
Being curious
View GitHub Profile
@rossta
rossta / webpacker.config.development.js
Created April 18, 2020 13:36
Webpacker's development webpack config output via console.dir()
ConfigObject {
mode: 'development',
output: {
filename: 'js/[name]-[contenthash].js',
chunkFilename: 'js/[name]-[contenthash].chunk.js',
hotUpdateChunkFilename: 'js/[id]-[hash].hot-update.js',
path: '/path/to/rails/app/public/packs',
publicPath: '/packs/',
pathinfo: true
},
@rossta
rossta / stripe_customer.rb
Created April 8, 2021 10:48
FactoryBot factory for a Hash class (i.e., not an ActiveRecord model)
FactoryBot.define :stripe_customer, class: Hash do
skip_create
initialize_with { new(attributes) }
id { "cus_#{SecureRandom.hex(7)}" }
object { "customer" }
address { nil }
balance { 0 }
created { 1.day.ago.to_i }
currency { "usd" }
@rossta
rossta / urlToPDF.js
Created June 2, 2023 19:33
Generate PDF from webpage with puppeteer
import puppeteer from 'puppeteer';
const [, , url, folder = '.'] = process.argv;
if (!url) throw 'Must supply URL';
(async () => {
const browser = await puppeteer.launch({ headless: 'new' });
const page = await browser.newPage();
@rossta
rossta / ruby-resources.md
Last active January 26, 2024 19:58
Resources I recommend for learning Ruby and Rails

Resources I recommend to learn Ruby and Rails

New? Start here

I like jumping into tutorials first.

"How to write Ruby" Books