Skip to content

Instantly share code, notes, and snippets.

View notEthan's full-sized avatar
💭
🥕

Ethan notEthan

💭
🥕
View GitHub Profile
@notEthan
notEthan / include.rb
Created December 14, 2024 00:11
ruby module constant inclusion
module Scorpio
module Errors
class HTTPError < StandardError
end
end
end
module Scorpio
include Errors # ⬅️ defines Scorpio::HTTPError (or does it?)
end
@notEthan
notEthan / foo.rb
Created December 6, 2024 18:20
test 3
require "nonacat"
@notEthan
notEthan / jsi_filter_serialized_activerecord.rb
Created April 20, 2023 00:10
JSI filter serialized ActiveRecord
require 'jsi'
# db/model setup
require 'active_record'
dbpath = Pathname.new("tmp.sqlite3")
dbpath.unlink if dbpath.exist?
at_exit { dbpath.unlink }
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",

Schema

Abstract Extensible Status Identifiable Custom Properties Additional Properties Defined In
Can be instantiated No Experimental No Forbidden Permitted ur.schema.json
# Setup
require 'active_record'
require 'arms'
dbfile = "foos.sqlite3"
File.unlink(dbfile) if File.exist?(dbfile)
ActiveRecord::Base.establish_connection({
:adapter => "sqlite3",
:database => dbfile,
# Setup
require 'active_record'
require 'arms'
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:database => "foos.sqlite3"
)
ActiveRecord::Schema.define do

Keybase proof

I hereby claim:

  • I am notethan on github.
  • I am ethan_ (https://keybase.io/ethan_) on keybase.
  • I have a public key ASDFFSljCgsbTPXlUCJ4lg-BQwk_sJkKbZhT3MkiPP20wAo

To claim this, I am signing this object:

description: "A Contact"
type: "object"
properties:
name: {type: "string"}
phone:
type: "array"
items:
type: "object"
properties:
location: {type: "string"}