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
@kool79
kool79 / sfcclearningads
Created November 10, 2023 12:11
block ads sfcclearning
// ==UserScript==
// @name SfccDocAdRemover
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include https://sfcclearning.com/*
// @grant GM_addStyle
// @run-at document-idle
// ==/UserScript==
@kool79
kool79 / ExcelToTable.java
Created August 10, 2023 02:39 — forked from ejwinter/ExcelToTable.java
Turn an Excel (xlsx) file with a single table in it into a Guava table with a header indexed
/**
* This class takes an Excel spreadsheet and converts it into a Guava Table format.
* When other formats of the file are to be supported (like CSV, TSV etc.,) implement the apply method with that format.
*/
@Component
public class ExcelToTableLoader implements TableGenerator<File> {
private static final Logger logger = org.slf4j.LoggerFactory.getLogger(ExcelToTableLoader.class);
1. Перезапустить контейнер с другими параметрами
Есть такая утилита runlike - https://github.com/lavie/runlike/
Запустив runlike -p <имяконтейнера>, вы получите готовую команду для запуска с теми же параметрами, которые были использованы изначально.
Например, для какого-то тестового сервиса команда и вывод может выглядеть следующим образом:
runlike -p testservice вернет
docker run \
--name=testservice \
--user=test \
-p 8015:8080 \
--restart=always \
@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).
@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);
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 / 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
@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>
----------------------------------------------------------------------------
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 / 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