Skip to content

Instantly share code, notes, and snippets.

View alex-popov-tech's full-sized avatar
🏠
Working from home

Olexander Popov alex-popov-tech

🏠
Working from home
View GitHub Profile
@alex-popov-tech
alex-popov-tech / Test.java
Last active June 12, 2017 19:12
generateJsonForOptions
вариант 0
private String generateJsonForOptions(final String... values) {
return "{" + IntStream.range(0, values.length / 2)
.boxed()
.map(i -> String.format("\\\"%s\\\":\\\"%s\\\"", values[2 * i], values[2 * i + 1]))
.collect(joining(";")) + "}";
}
вариант 1
private String generateJsonForOptions(final String... values) {
@alex-popov-tech
alex-popov-tech / indes.js
Created September 4, 2017 22:16
Idea for nested steps functionality
class StepNode {
const stepName;
const func;
const that;
const args;
const nestedStepNode;
const getTail = function() {
tmp = this;
while (tmp.nestedStepNode != null) {
@alex-popov-tech
alex-popov-tech / alex-karabiner.json
Created June 11, 2018 20:14
karabiner mac setup
{
"title": "Caps Lock -> Esc/Ctrl | Arrow Keys -> NJKL | Home/PageUp/PageDown/End -> HUIO | Right Command -> Enter/Shift",
"rules": [
{
"description": "Change caps_lock to control if pressed with other keys, to escape if pressed alone.",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock",
@alex-popov-tech
alex-popov-tech / mysql-docker.sh
Created August 9, 2018 07:55 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
// first.ts
import { second } from './second';
export function first() {
console.log('first')
second()
}
first()
//second.ts
export class LoginForm {
private readonly logInButton = element(With.id('sub'));
@ScreenedStep()
async login(username: string, password: string): Promise<void> {
await this.setLogin(username);
await this.setPassword(password);
await this.submit();
}
export class LoginForm {
private readonly logInButton = element(With.id('sub'));
async login(username: string, password: string) {
await this.setLogin(username);
await this.setPassword(password);
await this.submit();
const mainpage = new MainPage();
await mainpage.shouldBeOpened()
import java.util.*;
import java.util.stream.IntStream;
import static java.util.stream.Collectors.toSet;
final class Matrix {
private final List<List<Integer>> matrix;
public Matrix(List<List<Integer>> matrix) {
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
}
http {
# user www-data;
# worker_processes auto;
# pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
}
http {