Skip to content

Instantly share code, notes, and snippets.

View victorbrender's full-sized avatar

victor.brender victorbrender

View GitHub Profile
@victorbrender
victorbrender / refactoring_example.rb
Created June 4, 2016 08:08 — forked from mehowte/refactoring_example.rb
Simple refactoring exercises and 2 minute commits version - with updated characterisation tests.
# This is a refactoring exercise.
#
# What to do?
#
# I. Simple refactoring
# 1. Look at the code of the class CorrectAnswerBehavior
# 2. Try to see what it does by running `ruby refactoring_example.rb`
# 3. Record characterisation tests by running `ruby refactoring_example.rb --record`
# 4. Make the code beautiful;)
# 5. You are allowed to modify only the code between markers (REFACTORING START/REFACTORING END).
jQuery.fn.selectText = function(){
var doc = document
, element = this[0]
, range, selection
;
if (doc.body.createTextRange) {
range = document.body.createTextRange();
range.moveToElementText(element);
range.select();
} else if (window.getSelection) {
font: "Helvetica Neue", 800;
font: "Times New Roman", 500;
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each) do
http://www.martyrestaurants.com/preparate-calde-cluj/preparate-pui-cluj/extra-crispy-chicken.html
http://www.martyrestaurants.com/garnituri-cluj/cartofi-copti-cu-rosmarin.html