Skip to content

Instantly share code, notes, and snippets.

Zack Hobson zenhob

Block or report user

Report or block zenhob

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
@zenhob
zenhob / gist:f70bbb802e3e6729a1a6
Created May 31, 2014
Bulding Go binaries for Raspberry Pi
View gist:f70bbb802e3e6729a1a6

To build a binary that will run on the Raspberry Pi, you need to have a Go cross compiler and enable it when building the executable.

To build the cross compiler for Linux/ARM (you only need to do this once):

cd /usr/local/go/src
sudo GOOS=linux GOARCH=arm ./make.bash --no-clean

Once you've done that, you can build a binary for Raspberry Pi:

@zenhob
zenhob / generic_api.rb
Created Apr 4, 2014
Starter Ruby client for your REST API, based on Faraday
View generic_api.rb
#
# This module is a starter Ruby client for your REST API, based on Faraday:
# https://github.com/lostisland/faraday/
#
# It supports HTTP basic authentication, sending and recieving JSON, and simple error reporting.
# I use this as a basis for building API clients in most of my Ruby projects.
#
# Use it like this:
#
# http = GenericApi.connect('http://localhost:3000/', 'myname', 'secret')
@zenhob
zenhob / keybase.md
Created Mar 21, 2014
keybase verification
View keybase.md

Keybase proof

I hereby claim:

  • I am zenhob on github.
  • I am zenhob (https://keybase.io/zenhob) on keybase.
  • I have a public key whose fingerprint is E38C 0422 C175 261F 81E2 16DF 9B7B 36D3 3954 B2B8

To claim this, I am signing this object:

View readme.md

hcl(1) -- Track time with Harvest time sheets

GETTING STARTED

You can install hcl directly from rubygems.org:

gem install hcl

or you can install from source:

View -
#!/bin/sh
#
# Patches and installs Ruby to expose OpenSSL context options, using rbenv.
#
# Based on http://philippe.bourgau.net/how-to-install-a-patched-ruby-interpreter-wit/
#
VERSION=2.0.0-p247
PATCH_URL="https://bugs.ruby-lang.org/attachments/download/4210/0001-Expose-the-SSLContext-options-attribute-in-Net-HTTP.patch"
PATCH_NAME=ssloptions
View -
{
"given_cipher_suites": [
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
"TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA",
"TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA",
View -
{
"given_cipher_suites": [
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
"TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA",
"TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA",
View -
{
"given_cipher_suites": [
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384",
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384",
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
"TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA",
"TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA",
@zenhob
zenhob / gist:5146625
Created Mar 12, 2013
JQuery-alike JSON client API. Includes promises and cross-browser compatibility.
View gist:5146625
define('json-client', function() {
var JSON_KEY;
var API_BASE = '';
var validResponses = {
200: true,
201: true,
204: true
View gist:1989246

AccessibleFor: key-based hash sanitizer for Ruby

This is a simple mass-assignment security module loosely based on [ActiveModel::MassAssignmentSecurity][1]. It attempts to steal the good ideas and some of the API while being compatible with Rails 2.3-based applications.

Only attr_accessible (or its equivalent, keep reading) is implemented, because attr_protected is just a bad ActiveRecord API that hung around for some reason, and we don't want it stinking up the place.

You can’t perform that action at this time.