Skip to content

Instantly share code, notes, and snippets.

👍
webby goodness

Tad Thorley phaedryx

👍
webby goodness
Block or report user

Report or block phaedryx

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 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 = old_resolver.call(obj, args, ctx)
if result.is_a?(StandardError)
set_error_context(result, type, obj, field, args, ctx)
@scizo
scizo / nebulabrot.html
Created Jun 7, 2013
Nebulabrot forked from Jeremy Ashkenas' Buddhabrot in coffeescript
View nebulabrot.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<canvas id="buddhabrot" width="1000" height="1000"></canvas>
<div id="images"></div>
<script type="text/javascript">
var canvas = document.getElementById('buddhabrot'),
@masonforest
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
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/, '') }
end
get '/stream', provides: 'text/event-stream' do
You can’t perform that action at this time.