Skip to content

Instantly share code, notes, and snippets.

Avatar

Xavier Shay xaviershay

View GitHub Profile
@xaviershay
xaviershay / spec.json
Last active Oct 9, 2020
contribution-vs-interest
View spec.json
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"description": "Plots two functions using a generated sequence.",
"width": 600,
"height": 300,
"title": "Figure out what monthly contribution is equivalent to what savings rate",
"data": [{
"name": "month",
"values": [
@xaviershay
xaviershay / spec.json
Created Oct 9, 2020
interest-exploration
View spec.json
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"description": "Plots two functions using a generated sequence.",
"width": 600,
"height": 300,
"data": [{
"name": "month",
"values": [
],
View gist:865e3cd84c5defe9ed65dd16de2ece80
rrffaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaffaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
View gist:005ca2ba734ab2bc4cded90e3680441f
symbols = %w(1L 1 1R 1L1 1R1 b bL bR bL1 bR1 b2 b3 c cL cR cL1 cR1 c2)
tape = %w(1R 1R cL1)
cursor = 0
L = -1
R = +1
state = 1
@xaviershay
xaviershay / splits_io_analyzer.rb
Created Apr 7, 2018
Analyzing splits IO data
View splits_io_analyzer.rb
require 'net/http'
require 'json'
require 'fileutils'
game_id = "3414" # ori_de
def cache(key, &block)
path = "cache/key-#{key.tr("/", "-")}"
FileUtils.mkdir_p(File.dirname(path))
if File.exists?(path)
View gist:bded3a35ae0494ec8f11ff994051bd3f
SunkenGladesRunaway
SunkenGladesNadePool
SunkenGladesNadeTree
SunkenGladesMainPool
SunkenGladesMainPoolDeep
FronkeyWalkRoof
WallJump
DeathGauntlet
WallJumpMapStone
AboveFourthHealth
View gist:08957022c6377f123b741c6050f8888b
### Keybase proof
I hereby claim:
* I am xaviershay on github.
* I am xshay (https://keybase.io/xshay) on keybase.
* I have a public key ASDeCNUvU5aeS2wT6D9XGzYM5ScS9DKBJL-nRjE3ETsr2Qo
To claim this, I am signing this object:
@xaviershay
xaviershay / migration_sql.rb
Created Aug 14, 2015
Get SQL output from a Rails migration
View migration_sql.rb
#!/usr/bin/env ruby
require_relative 'config/environment'
path = ARGV.shift || raise("specify migration as first argument")
require_relative path
filename = File.basename(path, ".rb")
timestamp, name = filename.split("_", 2)
View gist:a76a1bca03c212ff1c69
module ValueObject
def self.included(klass)
klass.extend(ClassMethods)
klass.attributes # Force instantiation
end
def initialize(data)
data.each do |key, value|
instance_variable_set("@#{key}", value)
end
@xaviershay
xaviershay / standalone_rom_sql.rb
Created Jul 20, 2015
Standalone script to play around with ROM. http://rom-rb.org/
View standalone_rom_sql.rb
# Standalone script to try http://rom-rb.org/ with a database
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'rom'
gem 'rom-sql'
gem 'rom-rails'
gem 'activemodel'
You can’t perform that action at this time.