Skip to content

Instantly share code, notes, and snippets.

View e10a's full-sized avatar
😄

ellen e10a

😄
  • Los Angeles, CA
View GitHub Profile
@jherax
jherax / configure.md
Last active May 2, 2024 21:54
VS Code: Debugging with Jest

VS Code: Debugging Jest

Sometimes, debugging with console.log is not enough to find out what is happening in the code, as console.log prints only plain objects but neither functions nor objects with circular references. Besides, it's possible you may need to know the context and flow of the code.

Read more about debugging with VS Code in VS Code: Debugging.

@e10a
e10a / aws s3
Last active May 2, 2024 19:13
aws s3
aws s3api put-object-acl --bucket rocksbox --key site/homepage/2024/phase1/LO-HP-Hero-Desktop.jpg --acl public-read
aws s3api put-object-acl --bucket rocksbox --key site/homepage/2024/phase1/LO-HP-Hero-Mobile.jpg --acl public-read
aws s3api get-object-acl --bucket rocksbox --key site/homepage/2024/phase1/filename.xxx
@zdennis
zdennis / browser_logging.rb
Created June 26, 2018 19:11
Chromedriver browser logging for Capybara
# browser_logging.rb will print out the browser log from Chrome
# when running specs with "js: true". This is so we can easily debug
# issues where there are JS errors or other console warnings/error(s), etc.
#
# Output file is: Rails.root/log/browser.log
#
# Note: Nothing will be printed out for non-JS examples.
RSpec.configure do |config|
browser_log = File.new(Rails.root.join("log/browser.log").to_s, "w")
browser_log.sync = true
@mars
mars / register_chrome_with_window_size.rb
Created October 13, 2013 01:58
Set window size for Capybara/Selenium/chromedriver
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app,
browser: :chrome,
desired_capabilities: {
"chromeOptions" => {
"args" => %w{ window-size=1024,768 }
}
}
)
end
@alexbrinkman
alexbrinkman / Capybara Cheat Sheet.md
Last active May 2, 2024 05:44
A List of Methods for Capybara

Navigating

visit "/projects"
visit post_comments_path(post)

Clicking links and buttons

click_link "id-of-link"
click_link "Link Text"
@exadeci
exadeci / Capybara.md
Created September 15, 2015 10:11 — forked from tomas-stefano/Capybara.md
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@stevenyap
stevenyap / Capybara.md
Created October 23, 2013 05:03
Capybara Cheatsheet

Refer to: https://github.com/jnicklas/capybara

Note: Capybara does not show exceptions created by app. It will instead only tell you that the element you are searching for is not found.

Setup

  • Gemfile setup
gem "capybara"
gem 'selenium-webdriver' # requires for live browser demostration
@tomas-stefano
tomas-stefano / Capybara.md
Last active May 2, 2024 05:16
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@raditotev
raditotev / capybara_waiting_methods.rb
Created December 3, 2017 19:29
Capybara waiting methods
# If you want to make sure there's exactly one
find(".active").click
# If you just want the first element
find(".active", match: :first).click
# All matching elements
find(".active", match: :first) # Wait for the first element
all(".active").each(&:click)
@CiprianSpiridon
CiprianSpiridon / Laravel-Blade-Template-Cheatsheet
Last active April 10, 2024 06:12
Laravel Blade Template Cheatsheet
{{ $var }} - Echo content
{{ $var or 'default' }} - Echo content with a default value
{{{ $var }}} - Echo escaped content
{{-- Comment --}} - A Blade comment
@extends('layout') - Extends a template with a layout
@if(condition) - Starts an if block
@else - Starts an else block
@elseif(condition) - Start a elseif block
@endif - Ends a if block