Skip to content

Instantly share code, notes, and snippets.

View haugstrup's full-sized avatar

Andreas Haugstrup Pedersen haugstrup

View GitHub Profile
@haugstrup
haugstrup / qr.json
Last active April 19, 2017 21:45
Match Play QR code structures
// User type: Represents a user account
{
"type": "user",
"source": "matchplay", // Identifies the owner of internal IDs
"name": "Andreas Haugstrup Pedersen",
"user_id": 1, // Internal ID
"ifpa_id": 15925,
}
// Player type: Represents a player in a tournament

Keybase proof

I hereby claim:

  • I am haugstrup on github.
  • I am haugstrup (https://keybase.io/haugstrup) on keybase.
  • I have a public key whose fingerprint is 2528 78A1 C67D 5F3B 1D39 F8A3 491E 2DF2 B65B 09E2

To claim this, I am signing this object:

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 / podio-push-sample.js
Last active April 6, 2018 11:55
Sample for working with Podio's CometD/Bayeux service.
/*
Based on example code from Carl-Fredrik Herö from Elvenite AB <http://elvenite.se/>
Install dependencies:
* npm install faye
* npm install git://github.com/haugstrup/podiojs.git
Add needed info:
* Populate client_id and client_secret for your API key
@haugstrup
haugstrup / podio-redis.php
Last active December 12, 2015 04:28
Podio example with Redis caching
<?php
// Setup Podio Client
Podio::setup(CLIENT_ID, CLIENT_SECRET);
// Setup Redis
$redis = new Predis\Client(REDIS_INFO)
$my_cache_key = "podio_cache";
@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

@haugstrup
haugstrup / lcd.js
Created July 29, 2012 17:15
LCD proof of concept for johnny-five
// Wire up LCD as described here:
// http://learn.adafruit.com/character-lcds/overview
var five = require("johnny-five"),
board, lcd;
board = new five.Board();
board.on("ready", function() {