Skip to content

Instantly share code, notes, and snippets.

View notEthan's full-sized avatar
💭
🥕

Ethan notEthan

💭
🥕
View GitHub Profile
@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",
@notEthan
notEthan / gist:c0056cd9547f09a87a47809cc400564c
Created January 18, 2020 12:46
/Users/ethan/.rvm/log/1579350937_ruby-2.6.5/rubygems.install.log
[2020-01-18 04:38:02] /Users/ethan/.rvm/rubies/ruby-2.6.5/bin/ruby
current path: /Users/ethan/.rvm/src/rubygems-3.0.6
GEM_HOME=/Users/ethan/.rvm/gems/ruby-2.7.0-preview1
PATH=/usr/local/opt/coreutils/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/Users/ethan/.rvm/gems/ruby-2.7.0-preview1/bin:/Users/ethan/.rvm/gems/ruby-2.7.0-preview1/bin:/Users/ethan/.rvm/rubies/ruby-2.7.0-preview1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/MacGPG2/bin:/Users/ethan/bin:/Users/ethan/vhome/bin:/usr/local/mysql/bin:/usr/local/openresty/bin:/usr/local/openresty/nginx/sbin:/Applications/Firefox.app/Contents/MacOS:/Applications/Sublime Text.app/Contents/SharedSupport/bin:/Applications/VLC.app/Contents/MacOS:/Applications/kdiff3.app/Contents/MacOS:/Applications/p4merge.app/Contents/MacOS:/Applications/Synergy.app/Contents/MacOS:/Users/ethan/.rvm/bin:/Users/ethan/bin:/Users/ethan/vhome/bin:/usr/local/mysql/bin:/usr/local/openresty/bin
@notEthan
notEthan / gist:c3c32bb87362a1c54399d3313ffb367c
Created January 18, 2020 12:44
rvm install 2.6 (rvm_ignore_gemsets_flag=1)
ethan@next:~ ⦿ $ rvm install 2.6
Warning, new version of rvm available '1.29.9', you are using older version '1.29.9-next'.
You can disable this warning with: echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable auto-update with: echo rvm_autoupdate_flag=2 >> ~/.rvmrc
You can update manually with: rvm get VERSION (e.g. 'rvm get stable')
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.12/x86_64/ruby-2.6.5.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.

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"}