Instantly share code, notes, and snippets.

View gist:a90cc9cea5df42c3ae63099ce4ceb9ee
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()
View po.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();
}
View example
// first.ts
import { second } from './second';
export function first() {
console.log('first')
second()
}
first()
//second.ts
View mysql-docker.sh
# 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
View alex-karabiner.json
{
"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",
View indes.js
class StepNode {
const stepName;
const func;
const that;
const args;
const nestedStepNode;
const getTail = function() {
tmp = this;
while (tmp.nestedStepNode != null) {
View Test.java
вариант 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) {