Skip to content

Instantly share code, notes, and snippets.

View elgalu's full-sized avatar

Leo Gallucci elgalu

View GitHub Profile
# https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#exampleObject
responses:
"200":
description: |-
200 300 response
examples:
application/json: |-
{
"versions": [
{
@elgalu
elgalu / smaato.sh
Last active March 9, 2016 14:20
smaato jenkins setup ideas
# DDBB
docker run --name spx_db_$BUILD_ID -d \
-e MYSQL_ROOT_PASSWORD="password" \
-e MYSQL_DATABASE="our_mysql_ddbb" \
-e MYSQL_USER="user" \
-e MYSQL_PASSWORD="password" \
mysql
# SPX
docker run --name=spx_ui_$BUILD_ID -d --net=container:spx_db_$BUILD_ID \
@elgalu
elgalu / dconf-custom-keybindings.sh
Created January 22, 2016 14:38
Sample custom key bindings through dconf-tools cli
# requirements
sudo apt-get install -qyy dconf-tools
# careful, if you already have custom hotkeys this commands will overwrite the first 7 ...
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/name "'SouthWest(7)0,1080'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/binding "'<Primary><Super>a'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/command "'wmctrl -r :ACTIVE: -e 7,0,1080,-1,-1'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/name "'SouthEast(9)1920,1080'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/binding "'<Primary><Super>d'"
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/command "'wmctrl -r :ACTIVE: -e 9,1920,1080,-1,-1'"
This file has been truncated, but you can view the full file.
> gemini@1.0.4 test /home/user/oss/gemini
> istanbul test _mocha -- --recursive test/unit test/functional test/browser
Tue, 27 Oct 2015 10:45:07 GMT mocha:suite bail undefined
Tue, 27 Oct 2015 10:45:07 GMT mocha:suite enableTimeouts true
Tue, 27 Oct 2015 10:45:07 GMT mocha:suite timeout 0
Tue, 27 Oct 2015 10:45:07 GMT mocha:suite bail undefined
Tue, 27 Oct 2015 10:45:07 GMT mocha:suite timeout 0
Tue, 27 Oct 2015 10:45:07 GMT mocha:suite enableTimeouts false
$ node index.js ;echo $?
/home/user/Dropbox/dev-z/play/bstack/node_modules/browserstack-webdriver/lib/webdriver/promise.js:1702
throw error;
^
UnknownError: <html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>

Intro

The plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.

DNS

Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com, you'll need a record for that and for *.domain.com.

Different Operating Systems

@elgalu
elgalu / waitAbsent.js
Created November 27, 2014 16:35
Actively wait for an element to disappear either by becoming invisible or by not being present. Wait up to specTimeoutMs ignoring useless webdriver errors like StaleElementError.
/**
* Actively wait for an element to disappear either by becoming
* invisible or by not being present. Wait up to specTimeoutMs
* ignoring useless webdriver errors like StaleElementError.
*
* Usage:
* Add `require('./waitAbsent.js');` in your onPrepare block or file.
*
* @example
* expect($('.some-html-class').waitAbsent()).toBeTruthy();
@elgalu
elgalu / config.js
Created November 12, 2014 13:46
StackOverflow: Activating chrome language flags when activating from protractor (selenium)
// An example configuration file.
exports.config = {
// Capabilities to be passed to the webdriver instance.
capabilities: {
browserName: 'chrome',
chromeOptions: {
prefs: {
intl: { accept_languages: "fr-FR" }
}
}
@elgalu
elgalu / waitReady.js
Last active February 2, 2021 07:14
Actively wait for an element present and displayed up to specTimeoutMs ignoring useless webdriver errors like StaleElementError.
/**
* Actively wait for an element present and displayed up to specTimeoutMs
* ignoring useless webdriver errors like StaleElementError.
*
* Usage:
* Add `require('./waitReady.js');` in your onPrepare block or file.
*
* @example
* expect($('.some-html-class').waitReady()).toBeTruthy();
*/
@elgalu
elgalu / onPrepare_dollars.js
Created September 8, 2014 22:22
Dollar shortcuts for less typing, i.e. $model, $xpath, $linkText
/**
* Dollar shortcuts for less typing, i.e. $model, $xpath, $linkText...
*
* @example
* var nameElm = $model('user.name');
* // Equivalent to
* var nameElm = element(by.model('user.name'));
*
* @example
* var chainedElm =