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 'virtus' | |
require 'minitest/spec' | |
require 'minitest/autorun' | |
class A | |
include Virtus | |
attribute :foo, Boolean | |
end | |
describe 'without mongoid' do |
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 'eventmachine' | |
require 'json' | |
require 'net/http' | |
EM.run do | |
uri = URI('http://guest:[email protected]:15672/api/overview') | |
req = Net::HTTP::Get.new(uri.request_uri) | |
req.basic_auth(uri.user, uri.password) | |
EM::PeriodicTimer.new(1) do |
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
class Controller | |
def create | |
creator = OrganizationCreator.new(FeedWriter.new(self)) | |
creator.create_for(current_user, params[:organization]) | |
end | |
def create_organization_succeeded(organization) | |
redirect_to '/foo', :notice => 'success' | |
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
E, [2012-11-12T19:31:43.657071 #21162] ERROR -- : Reel::Server crashed! | |
SystemStackError: stack level too deep | |
/home/bernd/.rvm/gems/ruby-1.9.3-p327/gems/celluloid-0.12.3/lib/celluloid/tasks/task_fiber.rb:44 |
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
#!/bin/sh | |
sudo apt-get install python-software-properties | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java7-installer |
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 'active_model' | |
class ParamValidation | |
include ActiveModel::Validations | |
validates :page, :format => /\d+/ | |
attr_accessor :page |
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
diff --git lib/sensu/client.rb lib/sensu/client.rb | |
index 87b5351..9f28172 100644 | |
--- lib/sensu/client.rb | |
+++ lib/sensu/client.rb | |
@@ -222,14 +222,14 @@ module Sensu | |
def setup_sockets | |
@logger.debug('binding client tcp socket') | |
- EM::start_server('127.0.0.1', 3030, Sensu::Socket) do |socket| | |
+ EM::start_server('127.0.0.1', @settings[:client_port], Sensu::Socket) do |socket| |
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
class PerlFileProperties < FPM::Cookery::Recipe | |
description 'Perl module representing properties of a disk file' | |
name 'libfile-properties-perl' | |
version '0.02' | |
revision 0 | |
source "http://search.cpan.org/CPAN/authors/id/W/WO/WOHL/File-Properties-#{version}.tar.gz" | |
homepage "http://search.cpan.org/~wohl/File-Properties-#{version}/" | |
def build |
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
LoadPlugin exec | |
<Plugin exec> | |
Exec "nobody:nogroup" "/path/to/collectd-redis.rb" "127.0.0.1" "6379" | |
</Plugin> |
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 'open-uri' | |
require 'capybara/rspec' | |
app = lambda do |env| | |
[200, {'Content-Type' => 'text/plain'}, ['Hello rat!']] | |
end | |
Capybara.app = app | |
server = Capybara::Server.new(Capybara.app).boot |