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
source ~/.vim/rc.vim |
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 | |
require 'rubygems' | |
require 'net/http' | |
require 'digest/md5' | |
require 'pp' | |
begin | |
require 'faker' | |
rescue LoadError | |
puts "You should install faker gem. (gem install faker)" | |
exit |
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
#!/bin/sh | |
# at first you should remove gem alternative if it exists | |
# update-alternatives --remove-all gem | |
update-alternatives --remove-all ruby | |
update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.8 500 \ | |
--slave /usr/bin/ri ri /usr/bin/ri1.8 \ | |
--slave /usr/bin/erb erb /usr/bin/erb1.8 \ | |
--slave /usr/bin/rdoc rdoc /usr/bin/rdoc1.8 \ |
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
# This is a monkey patch for MessageVerifier — I need to change Marshal.load to JSON | |
if defined?(ActionController::Flash::FlashHash) | |
class ActionController::Flash::FlashHash | |
def to_json(*args) | |
{}.merge(self).merge({:used => @used}).to_json | |
end | |
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
user system total real | |
pure functional 1.820000 0.000000 1.820000 ( 1.817629) | |
mutable discriminator 1.530000 0.000000 1.530000 ( 1.534346) | |
imperative 1.110000 0.020000 1.130000 ( 1.118294) | |
cursor/iterator 2.370000 0.000000 2.370000 ( 2.373262) | |
true enumerator 2.090000 0.000000 2.090000 ( 2.089513) | |
Loaded suite sequences_by | |
Started | |
. | |
Finished in 0.000497 seconds. |
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 | |
# encoding: utf8 | |
$KCODE="u" | |
en_ru = { 'q'=>'й', 'w'=>'ц', 'e'=>'у', 'r'=>'к', 't'=>'е', 'y'=>'н', | |
'u'=>'г', 'i'=>'ш', 'o'=>'щ', 'p'=>'з', '['=>'х', ']'=>'ъ', | |
'a'=>'ф', 's'=>'ы', 'd'=>'в', 'f'=>'а', 'g'=>'п', 'h'=>'р', | |
'j'=>'о', 'k'=>'л', 'l'=>'д', ';'=>'ж', "'"=>'э', 'z'=>'я', | |
'x'=>'ч', 'c'=>'с', 'v'=>'м', 'b'=>'и', 'n'=>'т', 'm'=>'ь', | |
','=>'б', '.'=>'ю', '`'=>'ё', |
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
>> puts ThinkingSphinx.search('sergey').results[:matches] | |
{:doc=>49753, :weight=>3, :index=>0, :attributes=>{"sphinx_internal_id"=>2073, "class_crc"=>230816244, "subclass_crcs"=>[230816244], "sphinx_deleted"=>0}} | |
{:doc=>67561, :weight=>3, :index=>1, :attributes=>{"sphinx_internal_id"=>2815, "class_crc"=>230816244, "subclass_crcs"=>[230816244], "sphinx_deleted"=>0}} | |
{:doc=>67585, :weight=>3, :index=>2, :attributes=>{"sphinx_internal_id"=>2816, "class_crc"=>230816244, "subclass_crcs"=>[230816244], "sphinx_deleted"=>0}} | |
{:doc=>76609, :weight=>3, :index=>3, :attributes=>{"sphinx_internal_id"=>3192, "class_crc"=>230816244, "subclass_crcs"=>[230816244], "sphinx_deleted"=>0}} | |
{:doc=>86737, :weight=>3, :index=>4, :attributes=>{"sphinx_internal_id"=>3614, "class_crc"=>230816244, "subclass_crcs"=>[230816244], "sphinx_deleted"=>0}} | |
{:doc=>101569, :weight=>3, :index=>5, :attributes=>{"sphinx_internal_id"=>4232, "class_crc"=>230816244, "subclass_crcs"=>[230816244], "sphinx_deleted"=>0}} | |
{:doc=>1129, :weight=>2, :index=>6, |
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
#!/bin/sh | |
# standard ubuntu gem pakage adds alternative for gem | |
# it should be removed first time | |
# | |
# update-alternatives --remove-all gem | |
update-alternatives --remove-all ruby | |
update-alternatives --install /usr/bin/ruby ruby /opt/ruby-enterprise/bin/ruby 600 \ |
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 'rubygems' | |
require 'id3lib' | |
$KCODE = 'u' | |
require 'jcode' | |
require 'kconv' | |
FOLDER = '/Users/pa/Tmp/book' | |
AUTHOR = 'Лем С.' | |
BOOK_TITLE = 'Возвращение со звезд' |
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
#!/bin/sh -e | |
# chkconfig: 345 20 80 | |
# description: Atlassian JIRA | |
# init script for jira | |
# /etc/init.d/jira | |
# Define some variables | |
# Name of app ( JIRA, Confluence, etc ) | |
APP=JIRA | |
# Name of the user to run as |
OlderNewer