# The secret info we want to send (for us, this is the SFTP private key)
ruby -e '500.times { print "secret " }' > secret.unencrypted
# Generate the password
openssl rand 128 -out password.unencrypted
# Encrypt the secret with the password
openssl enc -aes-256-cbc -salt -in secret.unencrypted -out secret.encrypted -pass file:./password.unencrypted
# Get the public key we'll use to encrypt the password (this uses my public key, swap it for whoever you want to send the message to)

The Ruby Object Model (intro) aka "How Ruby Works"


The underlying structures that Ruby uses to interpret your code


More effective (explains more, simpler) than whatever you're otherwise doing


What is an implementable example?

I'll omit generalizations and make this overly concrete as I think it will be easier to understand what I'm looking for here.

An implementable example is a small example of a programming library that uses the core ideas of of the library. Its purpose is to make the interface very explicit, so that someone can say "if I didn't have this library, how would I make the example actually work?" and then go implement their solution and see it

View parse_otf.rb
# WOFF spec
# OTF spec
# Really nice inspector
# unpack instructions
# Font programming instruction definitions
# Font forge has some useful info, too, get it with homebrew cask
FONT_FILE = '/Users/xjxc322/gamut/bots/pxgamut_regular.woff'
require 'zlib'
View tco.c
#include <stdio.h>
int square(int n) {
return n * n;
int main(int argc, char const *argv[]) {
int a = 3;
int b = 2;
View what_is_a_poro.rb
# There is no official definition, this is the one I propose:
# Something is a PORO if it inherits from Object.
# The further you stray from that, the murkier it gets.
# Note that "A inherits from B" is basically the same thing as "A's superclass is B"
# Explicitly inheriting from Object
class Poro1 < Object
Poro1.superclass # => Object
View generating_bytecode.rb
def cancel
authorize OrderIssue
order_issue = OrderIssue.find(params[:id])
render_results(:results => order_issue,
:status => :ok,
:serializer => OrderIssueSerializer)
code =[0...__LINE__-1].join
View sql_injection_and_parameterizing_queries.rb
require 'active_record'
ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'
ActiveRecord::Base.logger = $stdout
ActiveSupport::LogSubscriber.colorize_logging = false
ActiveRecord::Schema.define do
create_table(:users) { |t| t.string :name }
# Create some users
User = ActiveRecord::Base
View rule_n.rb
require 'graphics'
require 'set'
class RuleN < Graphics::Simulation
def initialize(pixel_size, w, h)
self.pixel_size = pixel_size
self.rule_index = 30
self.needs_draw = true
self.cursor_pixel_offset = 0
self.initial_pixel_offsets = Set[0]
View ruby_parsing_and_vm.rb
code = <<-RUBY
class A
def whatevz
if 1