Skip to content

Instantly share code, notes, and snippets.

View vladimir-e's full-sized avatar

Vladimir Evdokimov vladimir-e

View GitHub Profile
@vladimir-e
vladimir-e / capybara cheat sheet
Created May 30, 2016 05:26 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
Ember.Test.registerHelper('selectFrom',
function(app, selector, value, description) {
// choose an option
find(selector).val(value);
// trigger the change
find(selector).change();
// assert the selected option
equal(find(selector+" option:selected").val(), value, description||"makes the selection");
// promise
return wait();
@vladimir-e
vladimir-e / seeds.rb
Created June 26, 2014 04:39 — forked from seyhunak/seeds.rb
Rails - Import SQL file as seed
unless Rails.env.production?
connection = ActiveRecord::Base.connection
connection.tables.each do |table|
connection.execute("TRUNCATE #{table}") unless table == "schema_migrations"
end
sql = File.read('db/import.sql')
statements = sql.split(/;$/)
statements.pop
@vladimir-e
vladimir-e / gist:5859601
Last active December 18, 2015 23:09 — forked from GromNaN/gist:1342799
Find process ID #pid
# Find the process ID
ps -ax | grep Safari
# Pause the process
kill -STOP 1234
# Resume the process
kill -CONT 1234
# Force stop