Skip to content

Instantly share code, notes, and snippets.

View lunich's full-sized avatar

Dmytro Strumilenko lunich

View GitHub Profile
en:
devise:
invitations:
send_instructions: 'Лист з запрошенням було відправлено на %{email}.'
invitation_token_invalid: 'Передано неправильний токен запрошення!'
updated: 'Пароль успішно встановлено. Ви успішно увійшли.'
no_invitations_remaining: "Не лишилось запрошень"
invitation_removed: 'Ваше запрошення було видалено.'
new:
header: "Надсилання запрошення"
@lunich
lunich / deprecate_assertions.rb
Last active December 9, 2015 22:48
Deprecation wrapper for standard ruby tests assert_* methods
module DeprecateAssertions
protected
def self.methods_to_replace
[
:assert,
:assert_block,
:assert_equal,
:assert_no_match,
:assert_not_equal,
:assert_nothing_raised,
@lunich
lunich / gist:914031
Created April 11, 2011 18:41
gsub! leak-test
SYMBOLS = ("a".."z").to_a
srand
def rand_word(len = 10)
SYMBOLS.sort_by { |_1,_2| rand <=> 0.5 }[0..(len-1)].join
end
was_affected = false
value = "some kind of initial value"
array_for_bulk_find_and_replace = (0..100_000).to_a.map { |c| [rand_word(3), rand_word(3)] }
array_for_bulk_find_and_replace.each_with_index do |replace_pair, i|