Skip to content

Instantly share code, notes, and snippets.

View evtuhovich's full-sized avatar

Ivan Evtuhovich evtuhovich

View GitHub Profile
# .autotest file in project folder for Ubunty with Gnome Notification
module Autotest::GnomeNotify
EXPIRATION_IN_SECONDS = 5
FAIL_IMAGE = "gtk-dialog-error"
PENDING_IMAGE = "gtk-dialog-warning"
SUCCESS_IMAGE = "gtk-dialog-info"
def self.notify title, message, stock_icon
options = "-t #{EXPIRATION_IN_SECONDS * 1000} -i #{stock_icon}"
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
set hlsearch
set incsearch
set t_Co=256
set ts=2
set sw=2
#!/usr/bin/env ruby
require 'tmpdir'
git_bundles = [
"git://github.com/astashov/vim-ruby-debugger.git",
"git://github.com/msanders/snipmate.vim.git",
"git://github.com/scrooloose/nerdtree.git",
"git://github.com/timcharper/textile.vim.git",
"git://github.com/tpope/vim-cucumber.git",
From f6ca31c4c261c8b4ac4e7badd3a0a807cf8d5779 Mon Sep 17 00:00:00 2001
From: Ivan Evtukhovich <evtuhovich@gmail.com>
Date: Sun, 29 Aug 2010 23:46:16 +0400
Subject: [PATCH 1/2] Specs for Float#mod bug, issue #451
---
spec/ruby/core/float/divmod_spec.rb | 3 +++
spec/ruby/core/float/shared/modulo.rb | 2 ++
2 files changed, 5 insertions(+), 0 deletions(-)
From 59c5b3824a16167ae975d382a8f4c293649757cd Mon Sep 17 00:00:00 2001
From: Ivan Evtukhovich <evtuhovich@gmail.com>
Date: Sun, 29 Aug 2010 23:46:40 +0400
Subject: [PATCH 2/2] Fix for Float#mod bug, issue #451
---
vm/builtin/float.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/vm/builtin/float.cpp b/vm/builtin/float.cpp
git clone "http://github.com/thoughtbot/paperclip.git" "/home/brun/.bundler/cache/git/paperclip-d045b5ce53b0476d7aca4a82ae1a37aa4de95077" --bare --no-hardlinks
Initialized empty Git repository in /usr/home/brun/.bundler/cache/git/paperclip-d045b5ce53b0476d7aca4a82ae1a37aa4de95077/
Segmentation fault: 11 (core dumped)
@evtuhovich
evtuhovich / .vimrc
Created November 12, 2010 15:20
My vimrc config file
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
set hlsearch
set incsearch
set t_Co=256
set ts=2
set sw=2
@evtuhovich
evtuhovich / gist:733479
Created December 8, 2010 16:08
nested transaction rollback documentation diff for rails 2.3.10
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb
index 0b6e52c..92a374d 100644
--- a/activerecord/lib/active_record/transactions.rb
+++ b/activerecord/lib/active_record/transactions.rb
@@ -135,7 +135,8 @@ module ActiveRecord
# end
# end
#
- # User.find(:all) # => empty
+ # User.find(:all) # => Returns Kotori and Nemu, because AcriveRecord::Rollback
@evtuhovich
evtuhovich / gist:733842
Created December 8, 2010 20:19
Rails 2.3.x nested transaction rollback
# File 1.rb, use rails 2.3.10
require 'config/environment'
puts Message.count
Message.transaction do
Message.create! :author => 'test', :text => 'test'
Message.transaction do
@evtuhovich
evtuhovich / gist:733876
Created December 8, 2010 20:36
Working rollback of nested transaction
require 'config/environment'
puts Message.count
Message.transaction do
Message.create! :author => 'test', :text => 'test'
Message.transaction(:requires_new => true) do
Message.create! :author => 'test', :text => 'test'