Skip to content

Instantly share code, notes, and snippets.

Alex Young regularfry

Block or report user

Report or block regularfry

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gemstash_problem.shell
$ cat /etc/nginx/sites-available/gemstash.conf
server {
listen 80;
listen [::]:80;
server_name gemstash;
keepalive_timeout 0;
location / {
proxy_pass http://127.0.0.1:9292;
@regularfry
regularfry / pdns_remote_http.md
Created Nov 8, 2015
pdns_server remote backend problem
View pdns_remote_http.md
View srpthoughts.org

SRP: two approaches, two definitions of “responsibility”

Using “Uncle Bob” and “Sandi Metz” as figureheads of each style because they’ve both written about them, not necessarily to imply any ownership of the concepts.

  • Uncle Bob: “Each module has a single responsibility TO SOMEONE”
    • If this applies at the class level, it can’t be usefully used at the method level
  • Sandi Metz: “Each class/method has a single responsibility FOR SOMETHING”
    • This implies the same test applied at two different levels of
View link-gems
View pattern-match.rb
#!/usr/bin/env ruby
class Matcher
def initialize( *args, &blk )
@args = args
@blk = blk
end
def call( *params )
matches = @args.zip(params).all?{|arg, param|
@regularfry
regularfry / pmbi
Created Oct 10, 2013
Poor Man's Bundle Install
View pmbi
#!/usr/bin/env ruby
lockfile=ARGV.shift
sources=[]
gems=[]
File.foreach(lockfile) do |line|
case line
when /^ remote: (.*)$/
sources << $1
when /^ (\S+) \((.*)\)$/
View gist:4708223
$ gem install ./jruby-openssl-0.7.7.gem
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
Fetching http://rubygems.org/latest_specs.4.8.gz
Fetching https://rubygems.org/latest_specs.4.8.gz
/home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:8: OpenSSL::SSL requires the jruby-openssl gem (LoadError)
from /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/ssl.rb:124:in `use_ssl='
from /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:248:in `connection_for'
from /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:329:in `request'
from /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:286:in `open_uri_or_path'
View gist:4707984
$ jruby -d -S gem install jruby-openssl
Exception `LoadError' at /home/zander/.rubies/jruby-1.5.1/lib/ruby/1.8/Win32API.rb:2 - Win32API only supported on win32
Exception `Gem::LoadError' at /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/1.8/rubygems.rb:777 - Could not find RubyGem jruby-openssl (>= 0)
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
Exception `Gem::LoadError' at /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/1.8/rubygems.rb:777 - Could not find RubyGem jruby-openssl (>= 0)
Exception `LoadError' at /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/shared/jruby/openssl/autoloads/x509.rb:8 - OpenSSL::X509 requires the jruby-openssl gem
Exception `Gem::LoadError' at /home/zander/.rubies/jruby-1.5.1/lib/ruby/site_ruby/1.8/rubygems.rb:777 - Could not find RubyGem test-unit (>= 0)
View aaargh2.sh
[11:38:20] zander@pancake: ~/tmp/rack/rack-jetty master!
$ gem list rake
*** LOCAL GEMS ***
rake (10.0.2)
[11:38:31] zander@pancake: ~/tmp/rack/rack-jetty master!
$ gem uninstall rake --version=10.0.2
INFO: gem "rake" is not installed
@regularfry
regularfry / gist:4030956
Created Nov 7, 2012
rvm jruby-1.5.1 fail
View gist:4030956
$ rvm install jruby-1.5.1 --disable-binary
jruby-1.5.1 - #downloading jruby-bin-1.5.1, this may take a while depending on your connection...
Error running '/home/zander/.rvm/scripts/fetch http://jruby.org.s3.amazonaws.com/downloads/1.5.1/jruby-bin-1.5.1.tar.gz', please read /home/zander/.rvm/log/jruby-1.5.1/fetch.log
$ cat /home/zander/.rvm/log/jruby-1.5.1/fetch.log
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11.5M 100 11.5M 0 0 47982 0 0:04:11 0:04:11 --:--:-- 48236
Downloaded archive checksum did not match, archive was removed!
If you wish to continue with not matching download add '--verify-downloads 2' after the command.
You can’t perform that action at this time.