Skip to content

Instantly share code, notes, and snippets.

View mokevnin's full-sized avatar

Kirill Mokevnin mokevnin

View GitHub Profile
@mokevnin
mokevnin / .irbrc.rb
Created October 13, 2010 07:20 — forked from dekart/.irbrc.rb
.irbrc
# 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
@mokevnin
mokevnin / .bashrc
Created October 13, 2010 07:23
.bashrc
# git
# show current branch
export PS1='\u@ \w$(__git_ps1 " [%s]") \$ '
@mokevnin
mokevnin / .caprc
Created October 13, 2010 09:11
.caprc
# 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
@mokevnin
mokevnin / .vimrc
Created January 28, 2011 12:52
.vimrc
set autoindent
module Gateways
@@class_name = :production
def self.class_name=(v)
@@class_name = v
end
#TODO автоматически для всех шлюзов
def self.ipgeobase
unless @ipgeobase
#!/usr/bin/env ruby
#TODO demonize and logging
require 'rubygems'
require 'eventmachine'
require 'evma_httpserver'
require 'em-zeromq'
Thread.abort_on_exception = true
# 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'
# 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
#TODO demonize and logging
require 'rubygems'
require 'em-zeromq'
require 'evma_httpserver'
Thread.abort_on_exception = true
class EMTestPullHandler
attr_reader :received
require 'spec_helper'
describe Web::Admin::SectionMaterialsController do
render_views
before do
Factory 'section/material'
end
describe "GET 'index'" do