Skip to content

Instantly share code, notes, and snippets.

View dmitry's full-sized avatar
🇪🇪
Water, earth and air.

Dmitry Polushkin dmitry

🇪🇪
Water, earth and air.
View GitHub Profile
puts page.driver.network_traffic.map(&:url)
save_and_open_page
screenshot_and_open_image
@dmitry
dmitry / test.rb
Created July 11, 2014 00:28
puffing-billy
require 'puffing-billy'
require 'billy'
Capybara.javascript_driver = :poltergeist_billy
Billy.configure do |c|
c.cache = true
c.cache_request_headers = true
c.ignore_params = []
c.path_blacklist = []
sudo add-apt-repository ppa:fossfreedom/byzanz
sudo apt-get update && sudo apt-get install byzanz

byzanz-record --duration=15 --x=200 --y=300 --width=700 --height=400 out.gif
classes = []
Dir.glob("test/**/*").each do |v|
begin
if File.file?(v)
classes << File.read(v).match(/class ([a-z0-9\:_]+)/i)[1]
end
rescue Exception => e
end
end
@dmitry
dmitry / why_test.md
Last active August 29, 2015 14:05
Why should I write tests?

Why test?

  • Design API;
  • Make sure code is working as it should;
  • Regression check.

Look how it's easy - all about time:

  • plan (before);
  • implement (current);
@dmitry
dmitry / application_policy.rb
Last active August 29, 2015 14:05
application_policy.rb with permitted_params or permitted_attributes used in active_admin
class ApplicationPolicy
attr_reader :user, :record
def initialize(user, record)
@user = user
@record = record
end
def index?
true
@dmitry
dmitry / readme.md
Last active August 29, 2015 14:05
Ideas of my perfect web development workflow

First of I would like to list all the steps how to get the money result without stress.

Router

Router is a state binding.

@dmitry
dmitry / readme.md
Last active August 29, 2015 14:05
Information types and characteristics

More contextual information - more TTL. NB! Not always.

Different types of information differentiated by a human. It's clearly can be seen that it's ordered by the quantity of information.

  • Chat (messages)
  • Microblog (and replies)
  • Wall post (and comments)
  • Forum topic (and answers or replies); also named as Group, Discussion, Question
  • Blog (and comments)
  • Article (and comments)
@dmitry
dmitry / info.md
Created September 5, 2014 17:22
Tenerife Rural and map related information