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
# Put this content to ~/.irbrc file (no extension) | |
require "rubygems" | |
begin | |
require "ap" | |
rescue LoadError => err | |
puts "Cannot find awesome_print gem. Please run 'gem install awesome_print' to install it." | |
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
# git | |
# show current branch | |
export PS1='\u@ \w$(__git_ps1 " [%s]") \$ ' |
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
# gem install capistrano_colors | |
# aptitude install libnotify-bin | |
def notify(message, body, urgency, icon = :info) | |
system("notify-send --urgency=#{urgency} --icon=#{icon} '#{message}' '#{body}'") | |
end | |
on :exit do | |
notify('Capistrano Task: Finished', ARGV.join(' '), :low) | |
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
set autoindent |
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
module Gateways | |
@@class_name = :production | |
def self.class_name=(v) | |
@@class_name = v | |
end | |
#TODO автоматически для всех шлюзов | |
def self.ipgeobase | |
unless @ipgeobase |
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
#!/usr/bin/env ruby | |
#TODO demonize and logging | |
require 'rubygems' | |
require 'eventmachine' | |
require 'evma_httpserver' | |
require 'em-zeromq' | |
Thread.abort_on_exception = true |
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
# sub.rb | |
require 'rubygems' | |
require 'zmq' | |
context = ZMQ::Context.new | |
chans = %w(rubyonrails ruby-lang) | |
sub = context.socket ZMQ::SUB | |
sub.connect 'tcp://127.0.0.1:5555' | |
sub.setsockopt ZMQ::SUBSCRIBE, 'id' |
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
# pub.rb | |
require 'rubygems' | |
require 'zmq' | |
context = ZMQ::Context.new | |
chan = ARGV[0] | |
pub = context.socket ZMQ::PUB | |
pub.bind 'tcp://*:5555' | |
while msg = STDIN.gets |
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
#TODO demonize and logging | |
require 'rubygems' | |
require 'em-zeromq' | |
require 'evma_httpserver' | |
Thread.abort_on_exception = true | |
class EMTestPullHandler | |
attr_reader :received |
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' | |
describe Web::Admin::SectionMaterialsController do | |
render_views | |
before do | |
Factory 'section/material' | |
end | |
describe "GET 'index'" do |
OlderNewer