Skip to content

Instantly share code, notes, and snippets.

webby goodness

Tad Thorley phaedryx

webby goodness
View GitHub Profile
View error_instrumentation.rb
# frozen_string_literal: true
class ErrorInstrumentation
def instrument(type, field)
old_resolver = field.resolve_proc
new_resolver = -> (obj, args, ctx) do
begin # rubocop:disable Style/RedundantBegin
result =, args, ctx)
if result.is_a?(StandardError)
set_error_context(result, type, obj, field, args, ctx)
scizo / nebulabrot.html
Created Jun 7, 2013
Nebulabrot forked from Jeremy Ashkenas' Buddhabrot in coffeescript
View nebulabrot.html
<!DOCTYPE html>
<canvas id="buddhabrot" width="1000" height="1000"></canvas>
<div id="images"></div>
<script type="text/javascript">
var canvas = document.getElementById('buddhabrot'),
masonforest / gist:4048732
Created Nov 9, 2012
Installing a Gem on Heroku from a Private GitHub Repo
View gist:4048732

Installing a Gem on Heroku from a Private GitHub Repo

Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.

Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.

  1. Get an OAuth Token from GitHub

First you will need to get an OAuth Token from GitHub using your own username and "note"

rkh / chat.rb
Created Dec 14, 2011
Simple Chat Application using the Sinatra Streaming API
View chat.rb
# coding: utf-8
require 'sinatra'
set server: 'thin', connections: []
get '/' do
halt erb(:login) unless params[:user]
erb :chat, locals: { user: params[:user].gsub(/\W/, '') }
get '/stream', provides: 'text/event-stream' do