Skip to content

Instantly share code, notes, and snippets.

@grncdr
grncdr / machine.js
Last active May 5, 2020 15:44
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'Order',
type: 'parallel',
context: {
has_bank_info: false
},
states: {
payment: {
initial: 'estimated',
states: {
@grncdr
grncdr / minimal-schema-loader.rb
Created November 5, 2021 20:41
The lowest-overhead way to get all tables & columns out of an ActiveRecord db/schema.rb
#!/usr/bin/env ruby
# frozen_string_literal: true
module Nop
def nop(*methods)
methods.each do |method|
define_method(method) { |*_args| nil }
end
end
end