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
# RSpec matcher for alias_method. | |
# https://gist.github.com/1950961 | |
# Usage: | |
# | |
# describe User do | |
# it { should alias_from(:username).to(:email) } | |
# end | |
RSpec::Matchers.define :alias_from do |alias_method| |
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
# RSpec matcher for validates_with. | |
# https://gist.github.com/2032846 | |
# Usage: | |
# | |
# describe User do | |
# it { should validate_with CustomValidator } | |
# end | |
RSpec::Matchers.define :validate_with do |validator| | |
match do |subject| |
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
# x server | |
Xvfb :1 -screen 0 1024x768x24 & | |
# seta display para o firefox achar o xvfb | |
export DISPLAY=:1 # export to /etc/profile | |
# mostra o processo | |
jobs | |
# mata o processo |
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
# ff plugins | |
ls /usr/lib/mozilla/plugins/ | |
# pode ser aqui tambem | |
ls /usr/lib/firefox-addons/plugins | |
# ff config | |
cat ~/.mozilla/firefox/<something>.default/prefs.js | |
# estar uma config para o ff |
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
profile = Selenium::WebDriver::Firefox::Profile.new | |
profile['browser.download.dir'] = "#{Rails.root.to_s}/tmp" | |
profile['browser.download.folderList'] = 2 | |
profile['browser.helperApps.neverAsk.saveToDisk'] = "text/ofx,application/ofx,application/x-ofx" | |
profile['pdfjs.disabled'] = true | |
profile['plugin.state.java'] = 2 # plugin java always active |
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
# import certificates | |
sudo keytool -import -alias cef.addtrustexternalcaroot -keystore "/usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts" -file "/home/otavio/certificados/AddTrustExternalCARoot" -storepass changeit | |
sudo keytool -import -alias cef.comodorsacertificationauthority -keystore "/usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts" -file "/home/otavio/certificados/COMODORSACertificationAuthority" -storepass changeit | |
sudo keytool -import -alias cef.comodorsaorganization -keystore "/usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts" -file "/home/otavio/certificados/COMODORSAOrganizationValidationSecureServerCA" -storepass changeit | |
# list imported certificates | |
sudo keytool -list -keystore "/usr/lib/jvm/java-8-oracle/jre/lib/security/cacerts" -storepass changeit | grep cef |
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
sudo apt-get install xdotool | |
# check java version on firefox | |
xdotool search --name "Verify Java Version" windowactivate --sync mousemove --window %1 500 350 click 1 | |
# click on run button of java security warning | |
xdotool search --name "Security Information" windowactivate --sync mousemove --window %1 410 290 click 1 | |
# SCREENSHOT, needs imagemagick | |
import -window root screenshot.png |
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
sudo apt-get install x11vnc | |
x11vnc -display :1 | |
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
# initializer to use when config.responders.flash_keys = [ :success, :error ] | |
module Responders | |
module FlashResponder | |
alias_method :original_set_flash_message?, :set_flash_message? | |
private | |
def set_flash_message? |
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
# ------- PRODUCTS | |
# mappings | |
PUT connectere | |
{ | |
"settings": { | |
"analysis": { | |
"analyzer": { | |
"ngram_analyzer": { | |
"tokenizer": "ngram_tokenizer", | |
"filter": [ |
OlderNewer