This file contains hidden or 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
require 'selenium-webdriver' | |
require 'pp' | |
class Inspector | |
attr_accessor :driver | |
def open url | |
@network_events = {} | |
@driver = Selenium::WebDriver::Driver.for :remote, url: "http://localhost:4444/wd/hub", desired_capabilities: capabilities | |
at_exit do |
This file contains hidden or 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
$ brew install tomcat | |
==> Downloading https://www.apache.org/dyn/closer.cgi?path=/tomcat/tomcat-9/v9.0.17/bin/apache-tomcat-9.0.17.tar.gz | |
==> Downloading from http://mirrors.advancedhosters.com/apache/tomcat/tomcat-9/v9.0.17/bin/apache-tomcat-9.0.17.tar.gz | |
######################################################################## 100.0% | |
==> Caveats | |
To have launchd start tomcat now and restart at login: | |
brew services start tomcat | |
Or, if you don't want/need a background service you can just run: | |
catalina run | |
==> Summary |
This file contains hidden or 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
%hello world example | |
-module(helloworld). | |
-export([start/0]). | |
start() -> | |
{ok, "Hello World"}. | |
% $ erl | |
% Erlang/OTP 21 [erts-10.3.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace] | |
% |
This file contains hidden or 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
*nat | |
:PREROUTING ACCEPT | |
:POSTROUTING ACCEPT | |
-A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080 | |
-A OUTPUT -o lo -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080 | |
COMMIT |
This file contains hidden or 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
caps = Selenium::WebDriver::Remote::Capabilities.chrome | |
caps['acceptInsecureCerts'] = true | |
caps['acceptSslCerts'] = true | |
caps['loggingPrefs'] = { 'performance' => 'ALL' } | |
caps['chromeOptions'] = { | |
'perfLoggingPrefs' => { 'enableNetwork' => true }, | |
:args => [ | |
"--disable-web-security", | |
"--allow-running-insecure-content", | |
"--ignore-certificate-errors", |
This file contains hidden or 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
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/ | |
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]` | |
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file. | |
Now let’s extract the certificate: | |
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]` |
This file contains hidden or 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
@entries ||= [] | |
selenium_driver = page.driver.browser | |
performance_log = selenium_driver.manage.logs.get("performance") | |
performance_log.each do |log| | |
json = JSON.parse(log.message) | |
if msg = json['message'] | |
if msg['method'] == "Network.requestWillBeSent" | |
_params = msg['params'] | |
url = _params['request']['url'] |
This file contains hidden or 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
wget http://erlang.org/download/otp_src_20.2.tar.gz | |
tar zxvf otp_src_20.2.tar.gz | |
cd otp_src_20.2 | |
./configure --prefix=/usr/local/elixir && make && sudo make install |
This file contains hidden or 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
vim bundle/nerdcommenter/plugin/NERD_commenter.vim | |
934 "let theLine = s:AddLeftDelim(s:Left({'space': 1}), theLine) | |
935 let theLine = s:AddLeftDelimAligned(s:Left({'space': 1}), theLine, 0) | |
Then Add to vimrc | |
let g:NERDDefaultAlign = 'left' |
This file contains hidden or 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
[[CustomAction sharedInstance] setRootProvider:cellView]; | |
GREYElementInteraction *elementInteraction = [[GREYElementInteraction alloc] initWithElementMatcher:matcher]; | |
[elementInteraction inRoot:nil]; | |
[elementInteraction setDataSource:[CustomAction sharedInstance]]; | |
[elementInteraction assertWithMatcher:grey_sufficientlyVisible() error:&error]; | |
if (error) { | |
} else { | |
dispatch_queue_t concurrent_queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); | |
dispatch_sync(concurrent_queue, ^{ |