Skip to content

Instantly share code, notes, and snippets.

View sotayamashita's full-sized avatar
💭
May be slow to respond

Sam Yamashita sotayamashita

💭
May be slow to respond
View GitHub Profile
@sotayamashita
sotayamashita / README.md
Last active May 15, 2019 18:19
Tips for Test Automation

Minimum browser compatibility

  • IE >= 11

Desired Capabilities

  • Windows
  • OS X
  • iOS
  • Android
@sotayamashita
sotayamashita / README.md
Created December 18, 2018 05:42
TIL: Get all changes file on this branch
@sotayamashita
sotayamashita / README.md
Last active February 28, 2024 03:59
Robot Framework Cheatsheet
@sotayamashita
sotayamashita / main.py
Created December 11, 2018 07:37
TIL: Start Chrome with WebDriver
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import os
options = Options()
options.add_argument('--headless')
# Other options are here. http://chromedriver.chromium.org/capabilities
driver = webdriver.Chrome(chrome_options=options)
driver.get("")
@sotayamashita
sotayamashita / README.md
Last active December 6, 2018 17:12
Sidekiq & Redis troubleshooting on Heroku

Redis database cannot found

  1. Click Redis Cloud or Redis To Go on resources
  2. Remove the add-on
  3. Reinstall add-on

Sidekiq started with {url: nil}

@sotayamashita
sotayamashita / README.md
Last active December 10, 2018 08:00
TIL: Add a custom rectangle to existing image with Ruby and RMagick
# Gemfile
gem 'rmagick'
require 'RMagick'

image = Magick::Image.read("before.png").first
gc = Magick::Draw.new
@sotayamashita
sotayamashita / s3.md
Last active December 5, 2018 13:49
TIL: How to control files on S3 from Ruby SDK
s3 = Aws::S3::Client.new(
  access_key_id: <>,
  secret_access_key: <>,
  region: <>,
)

Create a directory

@sotayamashita
sotayamashita / package.json
Last active December 4, 2018 07:07
TIL: Check ruby syntax against staged git files and don't let 💩 slip into your code base with husky and lint-staged
{
"devDependencies": {
"husky": "^1.2.0",
"lint-staged": "^8.1.0"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
@sotayamashita
sotayamashita / 05_shoryuken_setup.config
Last active December 4, 2018 05:25
Setup shoryuken on Elastic Beanstalk
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_shoryuken":
mode: "000777"
content: |
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
EB_SUPPORT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k support_dir)
. $EB_SUPPORT_DIR/envvars
. $EB_SCRIPT_DIR/use-app-ruby.sh
mkdir -p /var/app/support/pids
@sotayamashita
sotayamashita / 00README.md
Last active November 29, 2018 12:44
Robotframework + Google Chrome (headless)
  1. Install Robot Framework
  2. Install SeleniumLibrary