Skip to content

Instantly share code, notes, and snippets.

View rsanheim's full-sized avatar

Rob Sanheim rsanheim

View GitHub Profile
@rsanheim
rsanheim / classic_autoloading_hack.rb
Created February 28, 2024 18:47
debugging rails autoloading (classic mode)
# from https://makandracards.com/makandra/48754-how-to-debug-rails-autoloading
ActiveSupport::Dependencies.singleton_class.prepend(Module.new do
def load_missing_constant(*args)
Rails.logger.debug "#{__method__}(#{args.map(&:inspect).join(', ')})"
super
end
end)
[~/src/oss/derailed_benchmarks (main)]> BUNDLE_GEMFILE=gemfiles/rails_6_1.gemfile bundle exec rake
/Users/rsanheim/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/ruby-statistics-3.0.1/lib/statistics/statistical_test/f_test.rb:32: warning: assigned but unused variable - sample_stds
/Users/rsanheim/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/mini_histogram-0.3.1/lib/mini_histogram/plot.rb:80: warning: method redefined; discarding old plot
/Users/rsanheim/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/mini_histogram-0.3.1/lib/mini_histogram.rb:201: warning: previous definition of plot was here
/Users/rsanheim/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-6.1.7/lib/active_support/core_ext/class/subclasses.rb:30: warning: method redefined; discarding old subclasses
/Users/rsanheim/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/devise-4.8.1/lib/devise/rails/warden_compat.rb:4: warning: method redefined; discarding old request
/Users/rsanheim/.asdf/installs/ruby/3.1.2/lib/ruby/g
@rsanheim
rsanheim / turbo-bench.sh
Created October 28, 2022 08:45
little script to try and run turbo benchmarks
#!/usr/bin/env bash
# this all assumes you have homebrew and a working node 16+ setup
# get prereqs for rust / turbo
brew install sponge jq protobuf protoc-gen-go protoc-gen-go-grpc golang
# install rustup to bootstrap rust (installing rust via brew didn't work for me and seems to be not recommended)
brew install rustup

Excerpted from the guide at https://www.avsforum.com/threads/guide-to-subwoofer-calibration-and-bass-preferences.2958528/ written by https://www.avsforum.com/members/mthomas47.7878709/.

Cliff Notes:

Several people have suggested having some abbreviated HT calibration tips, so I have added a few prior to the actual Guide. Anyone wanting more detail on anything from room and speaker setup, to setting crossovers, to the differences between sealed and ported subs, to selecting and positioning subwoofers in a room, can find the pertinent information in the Guide itself. There are some similar abbreviated tips, to selecting subwoofers, at the beginning of Section VIII.

  1. Try to position speakers and subwoofers strategically, doing a "subwoofer crawl" if necessary. Section I-A gives some good general advice on locating the speakers on the front soundstage. (The front three speakers will have the most impact on the overall sound quality for most of the frequency range.) You can Google how to do a sub crawl, or yo
@rsanheim
rsanheim / heaven.md
Created May 2, 2018 18:25 — forked from atmos/heaven.md
Response to a dude who asked about heaven. https://github.com/holman/feedback/issues/422

@holman got a request about our deployment system, heaven

I know it's not a high priority, but has there been any activity on open-sourcing the core Heaven gem?

There is. I've been working on extracting the non-GitHub specific parts into two gems. This first is a CLI portion called hades. The second is an HTTP API portion called heaven.

When you open source something previously used as in internal tool like Heaven, Hubot, Boxen, etc., how do you manage and hook in the parts that need to stay internal?

Normally I focus around four questions:

find:

([\(\[]):(\w+)([\}\]])

replace:

$1"$2"$3
@rsanheim
rsanheim / optparse-template.rb
Created December 28, 2015 18:07 — forked from rtomayko/optparse-template.rb
Ruby optparse template
#!/usr/bin/env ruby
#/ Usage: <progname> [options]...
#/ How does this script make my life easier?
# ** Tip: use #/ lines to define the --help usage message.
$stderr.sync = true
require 'optparse'
# default options
flag = false
option = "default value"

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@rsanheim
rsanheim / ci.sh
Created March 28, 2012 05:03
Simple continuous deployment via Jenkins and Capistrano for all branches. Wire this up with Github post receive hooks from Jenkins for best results.
#!/bin/bash -x
# This should be your "script/ci" checked into version control, and then wired as your sole build step in Jenkins.
#
# Simplifying Assumptions:
#
# * You build all branches
# * You want to deploy all branches.
# * You wired up an SSH key to your CI server appropriately so it can talk to your deployment target(s) via Cap
@rsanheim
rsanheim / flash_helper.rb
Created March 13, 2012 19:41
Simple Flash Helper to display any flashes in a class
module FlashHelper
# Output a series of divs with the class being the flash type, and the content being the flash message
def render_flashes
flash.inject(String.new.html_safe) do |html, (key, value)|
content_tag(:div, value, :class => key)
end
end
end