This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after(:each) do | |
errors = page.driver.browser.manage.logs.get(:browser) | |
if errors.present? | |
message = errors.map(&:message).join("\n") | |
puts message | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remap prefix to Control + a | |
set -g prefix C-a | |
set -g default-terminal "xterm-256color" | |
set -s escape-time 0 | |
# bind 'C-a C-a' to type 'C-a' | |
bind C-a send-prefix | |
unbind C-b | |
# Lines of history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<header class="school-website-header uk-z-4"> | |
<div class="uk-padding-horizontal uk-container uk-container-center"> | |
<nav class="uk-navbar" data-behavior="dropdown"> | |
<a href="{{current_school.logo_navigation_url}}" class="uk-brand"> | |
{{ if current_school.logo_url }} | |
<img src="{{current_school.logo_url}}" alt="{{current_school.name}}"> | |
{{ else }} | |
<span class="uk-text-large uk-text-bold">{{ current_school.name }}</span> | |
{{ end }} | |
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Should be 8 records | |
ActiveRecord::Base.connection.execute(MembershipSummary.includes(:person).where(school_id: 2, group_id: 1).order("people.first_name asc NULLS LAST, person_id asc NULLS LAST").to_sql).count | |
# Should be 8 records but only returns 1 | |
MembershipSummary.includes(:person).where(school_id: 2, group_id: 1).order("people.first_name asc NULLS LAST, person_id asc NULLS LAST").to_a.size | |
# 'joins' does what we want and returns 8 records. Maybe we can figure out how to get ransack to do a join instead of includes | |
MembershipSummary.joins(:person).where(school_id: 2, group_id: 1).order("people.first_name asc NULLS LAST, person_id asc NULLS LAST").to_a.size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heroku pg:backups -r production # list existing backups | |
curl -o a123.dump `heroku pg:backups public-url a123 -r production` # pull the backup down locally | |
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d AppName_enviroment a123.dump | |
# Or even quicker | |
heroku pg:backups restore `heroku pg:backups public-url a123 -r sk-git-remote` DATABASE_URL -r sk-git-remote |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -o a425.dump `heroku pg:backups public-url a425 -r remote-name` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module FileType | |
2 module ProcessingGroup | |
3 Box = [PDF, Word, Powerpoint] | |
4 Video = [Video] | |
5 end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Capybara.default_driver = :webkit | |
RSpec.configure do |config| | |
config.before(debug: true) do | |
Capybara.current_driver = :selenium | |
end | |
config.after(debug: true) do | |
Capybara.use_default_driver | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Kss::Engine.routes.draw do | |
get '/someurl' => 'controllername#actionname' | |
root :to => 'home#index' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Capybara.register_driver :webkit do |app| | |
connection = Capybara::Webkit::Connection.new(socket_class: TCPSocket, stderr: File.open('/dev/null', 'a')) | |
browser = Capybara::Webkit::Browser.new(connection) | |
Capybara::Webkit::Driver.new(app, browser: browser) | |
end |