This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "spec_helper" | |
resource "Errors" do | |
get "/errors/:id" do | |
parameter :id, "Error ID" | |
let(:error) { OpenStruct.new(id: 1) } | |
let(:id) { error.id } | |
example "Get a single error" do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
$raise = true | |
raise RuntimeError if $raise | |
puts "raise: #{$raise}" | |
rescue RuntimeError | |
$raise = false | |
puts "in rescue, raise: #{$raise}" | |
retry | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, TypeSynonymInstances, FlexibleContexts, NoMonomorphismRestriction #-} | |
-- config description | |
-- | |
import XMonad | |
import XMonad.Config.Gnome | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Hooks.ManageHelpers | |
import XMonad.Hooks.FadeInactive | |
import XMonad.Hooks.EwmhDesktops (ewmh) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
else if (strcmp(cmd, "FUCK") == 0 && n_args == 1) { | |
client_output_printf(c, "+ FUCK: Go fuck yourself!\n"); | |
c->state = CLIENT_DEAD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV['RACK_ENV'] = 'test' | |
require 'bundler/setup' | |
require 'test/unit' | |
gem 'minitest' | |
require 'timecop' | |
require 'grape' | |
require 'logger' | |
Grape::API.logger = Logger.new('/dev/null') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'goliath' | |
require 'grape' | |
class OhSnap < Grape::API | |
get :one do | |
{"oh" => "bugger!"} | |
end | |
end | |
class MyGrape < Goliath::API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'goliath' | |
require 'grape' | |
class OhSnap < Grape::API | |
version 'v1', using: :header, vendor: 'drug', format: :json | |
get :one do | |
{"oh" => "bugger!"} | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[sensei@zapp: +1] ~ ruby-1.9.2-p290 | |
» rvm gemset use test | |
[sensei@zapp: +1] ~ ruby-1.9.2-p290@test | |
» gem list | |
*** LOCAL GEMS *** | |
bundler (1.0.21) | |
[sensei@zapp: +1] ~ ruby-1.9.2-p290@test | |
» gem install em-synchrony |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'em-spec/test' | |
require 'exceptioner_api/application' | |
require 'logger' | |
ENV['EXCEPTIONER_HOST'] ||= '127.0.0.1' | |
ENV['EXCEPTIONER_PORT'] ||= '1234' | |
class Exceptioner::API::TestCase < Test::Unit::TestCase | |
include EM::TestHelper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/setup' | |
require 'eventmachine' | |
module Handler | |
include EM::Deferrable | |
def connection_completed | |
start_tls(verify_peer: false) | |
end |