Skip to content

Instantly share code, notes, and snippets.

@mgrybyk
mgrybyk / index.js
Last active February 17, 2022 12:17
Kattis-flipfive
const readline = require("readline");
const WHITE = "."; // 0
const SIZE = 3;
const SIZE_SQUARE = SIZE * SIZE;
const LEADING_ZEROS = "0".repeat(SIZE_SQUARE);
const inputData = [];
var rl = readline.createInterface({
input: process.stdin,
@mgrybyk
mgrybyk / IRCommandMapping.h
Last active September 13, 2022 20:30
arduino uno + WS2812B + IR
// Codes
#define IR_CH_MIN 0x45
#define IR_CH 0x46
#define IR_CH_PLUS 0x47
#define IR_PREV 0x44
#define IR_NEXT 0x40
#define IR_PLAY 0x43
#define IR_VOL_MIN 0x07
#define IR_VOL_PLUS 0x15
@mgrybyk
mgrybyk / compiled_proxy.js
Last active February 4, 2022 01:15
WebdriverIO - new async api
// proxy.ts after compilation
async function p$(selector) {
return pElementFactory.call(this, selector)
}
async function shadow$(selector) {
return pElementFactory.call(this, selector)
}
async function p$$(selector) {
return [pElementFactory.call(this, selector, 0), pElementFactory.call(this, selector, 1)]
@mgrybyk
mgrybyk / datepicker.js
Last active February 4, 2022 01:06
WebdriverIO snippets
const lang = 'en'
describe('element ui date picker', () => {
it('set current date +60 days', () => {
browser.url('https://element.eleme.io/#/en-US/component/date-picker')
const datePickerInput = $('.el-date-editor>input')
expect(datePickerInput).toBeClickable()
const datePicker = new DatePickerElement(datePickerInput)
pipeline {
agent any
options {
timeout(time: 20, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr: '300'))
}
parameters {
booleanParam(
@mgrybyk
mgrybyk / general.ini
Last active April 14, 2023 12:07
GeForce Now - Witcher 3 - enable console
[General]
ConfigVersion=2
DBGConsoleOn=true
@mgrybyk
mgrybyk / solution.ts
Last active January 15, 2020 22:38
2D server grid update
/**
* Calculate days required to update all servers
*
* O(rows * columns)
*
* @param rows rows in grid array
* @param columns columns in grid array
* @param grid servers 2D array
*
* @returns days required to update all servers or -1 if it's not possible
@mgrybyk
mgrybyk / ArrayList
Last active October 10, 2020 16:19
Data Structures
// please don't use it! It's just a draft that contains defects and is not fully implemented!
class ArrayList {
constructor (initialSize = 16) {
this._initialSize = initialSize
this._threshold = initialSize
this._size = 0
this._bucket = new Array(initialSize)
}
@mgrybyk
mgrybyk / get performance metrics
Last active December 18, 2019 01:13
selenium v4 CDP
import org.junit.jupiter.api.Test;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.devtools.DevTools;
import org.openqa.selenium.devtools.performance.Performance;
class MySeleniumTest {
static final String CHROMEDRIVER_PATH = "/Users/m/sources/ag/e2e/node_modules/selenium-standalone/.selenium/chromedriver/79.0.3945.36-x64-chromedriver";
@Test
void myTest() {
@mgrybyk
mgrybyk / podbot.md
Created November 11, 2019 20:47 — forked from matheusagcosta/podbot.md
Podbot Counter Strike 1.6 on Mac OSX

1 - Make sure you have Counter Strike installed

2 - Download YAPB http://forums.bots-united.com/showthread.php?t=9986

3 - Extract the zip and move the folder addons with all the content to ~/Library/Application Support/Steam/steamapps/common/Half-Life/cstrike

4 - After that, open the file liblist.gam in the folder above and replace gamedll_osx "dlls/cs.dylib" with this content:

//gamedll_osx "dlls/cs.dylib"