Skip to content

Instantly share code, notes, and snippets.

View kool79's full-sized avatar

Oleksandr Kulychok kool79

  • Astound Commerce
  • Ukraine, Vinnitsa
View GitHub Profile
package qa.ok.fw.test;
import java.net.MalformedURLException;
import java.net.URL;
import java.time.Duration;
import java.time.LocalTime;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.BrowserType;
2018-09-03 20:32:57:485 - [Appium] Welcome to Appium v1.9.0
2018-09-03 20:32:57:486 - [Appium] Non-default server args:
2018-09-03 20:32:57:487 - [Appium] port: 4724
2018-09-03 20:32:57:487 - [Appium] sessionOverride: true
2018-09-03 20:32:57:488 - [Appium] logTimestamp: true
2018-09-03 20:32:57:488 - [Appium] localTimezone: true
2018-09-03 20:32:57:488 - [Appium] nodeconfig: node-appium.json
2018-09-03 20:32:57:488 - [Appium] debugLogSpacing: true
2018-09-03 20:32:57:488 - [Appium] defaultCapabilities: {
2018-09-03 20:32:57:489 - [Appium] appium:newCommandTimeout: 100
@kool79
kool79 / commit-message-guidelines.md
Created September 25, 2018 16:22 — forked from robertpainsi/commit-message-guidelines.md
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
----------------------------------------------------------------------------
java-client tries to detect id element isDisplayed() with atom execution:
----------------------------------------------------------------------------
2018-10-11 05:26:50:938 - [HTTP] --> POST /wd/hub/session/43c81083-c3a6-4def-9bab-91f046ff21b0/execute/sync
2018-10-11 05:26:50:938 - [HTTP] {"script":"return (function(){return function(){var k=this;function l(a){return void 0!==a}function m(a){return\"string\"==typeof a}function aa(a,b){a=a.split(\".\");var c=k;a[0]in c||!c.execScript||c.execScript(\"var \"+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&l(b)?c[d]=b:c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}}\nfunction ba(a){var b=typeof a;if(\"object\"==b)if(a){if(a instanceof Array)return\"array\";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if(\"[object Window]\"==c)return\"object\";if(\"[object Array]\"==c||\"number\"==typeof a.length&&\"undefined\"!=typeof a.splice&&\"undefined\"!=typeof a
@kool79
kool79 / Jenkinsfile
Created February 8, 2019 18:37 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage concurrency constraints, ...
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
/*
Please make sure to add the following environment variables:
HEROKU_PREVIEW=<your heroku preview app>
HEROKU_PREPRODUCTION=<your heroku pre-production app>
HEROKU_PRODUCTION=<your heroku production app>
@kool79
kool79 / latency.txt
Created February 15, 2019 16:35 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
package webdav.support;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.google.common.base.Preconditions;
import org.apache.commons.lang3.tuple.Pair;
public class RangeSpecification {
@kool79
kool79 / reuse-code.js
Created February 19, 2021 17:02 — forked from JamesMessinger/reuse-code.js
Saving JavaScript code to a variable in Postman
// Save common tests in a global variable
postman.setGlobalVariable("commonTests", () => {
// The Content-Type must be JSON
tests["Content-Type header is set"] = postman.getResponseHeader("Content-Type") === "application/json";
// The response time must be less than 500 milliseconds
tests["Response time is acceptable"] = responseTime < 500;
// The response body must include an "id" property
var data = JSON.parse(responseBody);
@kool79
kool79 / crypto-aes-256-gcm-demo.js
Created February 19, 2021 23:51 — forked from rjz/crypto-aes-256-gcm-demo.js
example using node.js crypto API with aes-256-gcm
const buffer = require('buffer');
const crypto = require('crypto');
// Demo implementation of using `aes-256-gcm` with node.js's `crypto` lib.
const aes256gcm = (key) => {
const ALGO = 'aes-256-gcm';
// encrypt returns base64-encoded ciphertext
const encrypt = (str) => {
// Hint: the `iv` should be unique (but not necessarily random).
1. Перезапустить контейнер с другими параметрами
Есть такая утилита runlike - https://github.com/lavie/runlike/
Запустив runlike -p <имяконтейнера>, вы получите готовую команду для запуска с теми же параметрами, которые были использованы изначально.
Например, для какого-то тестового сервиса команда и вывод может выглядеть следующим образом:
runlike -p testservice вернет
docker run \
--name=testservice \
--user=test \
-p 8015:8080 \
--restart=always \