This file contains hidden or 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
| def has_id?(doc) | |
| # mongo-ruby-driver seems to take :_id over '_id' for some reason | |
| id = doc[:_id] || doc['_id'] | |
| return id if id | |
| nil | |
| end | |
| def sanitize_id!(doc) | |
| doc[:_id] = has_id?(doc) || BSON::ObjectId.new | |
| doc.delete('_id') |
This file contains hidden or 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 'dbus' | |
| require 'eventmachine' | |
| module EM | |
| module Avahi | |
| AVAHI = "org.freedesktop.Avahi" | |
| AVAHI_SERVER = "org.freedesktop.Avahi.Server" | |
| AVAHI_BROWSER = "org.freedesktop.Avahi.ServiceBrowser" | |
| class ServiceBrowser |
This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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) |