Skip to content

Instantly share code, notes, and snippets.

View haugstrup's full-sized avatar

Andreas Haugstrup Pedersen haugstrup

View GitHub Profile

The reason why you might get certificate errors in Ruby 2.0 when talking HTTPS is because there isn't a default certificate bundle that OpenSSL (which was used when building Ruby) trusts.

Update: this problem is solved in edge versions of rbenv and RVM.

$ ruby -rnet/https -e "Net::HTTP.get URI('https://github.com')"
net/http.rb:917:in `connect': SSL_connect returned=1 errno=0 state=SSLv3
  read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)

You can work around the issue by installing a certificate bundle that you trust. I trust Mozilla and curl.

@haugstrup
haugstrup / phpunit.rb
Last active August 29, 2015 13:55 — forked from itspriddle/phpunit.rb
require 'formula'
class Phpunit < Formula
homepage 'http://www.phpunit.de/manual/current/en/index.html'
url 'http://pear.phpunit.de/get/phpunit.phar'
sha1 '4eb4534a98067c7c3bcbfd0963c826a6238ae2a7'
version 'HEAD'
def install
bin.install "phpunit.phar" => "phpunit"
@haugstrup
haugstrup / notes.md
Created September 5, 2012 05:33 — forked from rmurphey/notes.md
Johnny-Five: 7-Segment Display with Shift Register

Johnny-Five: 7-Segment Display with Shift Register

seven segment display with shift register

See code for presumed segment layout. Segment A is attached to Q0 of the shift register, B-Q1, etc. The DP is attached to Q7.

schematic