Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢
meh

Aleksandr Shpak shpaker

🐢
meh
View GitHub Profile
@shpaker
shpaker / add_allure_environment_property_fixture.py
Last active Mar 6, 2020
Implementation of the pytest fixture for adding information to the Environment widget
View add_allure_environment_property_fixture.py
from os import path
from typing import Any, Callable, Optional
from _pytest.fixtures import SubRequest
from pytest import fixture
ALLURE_ENVIRONMENT_PROPERTIES_FILE = 'environment.properties'
ALLUREDIR_OPTION = '--alluredir'
@shpaker
shpaker / feeds.yml
Created Dec 30, 2019
configuration for feedforbot
View feeds.yml
# ================ RADIO-T https://telegram.me/radiotnews
# Umputun
- url : 'http://feeds.rucast.net/Umputun'
id : '@radiotnews'
format : '&#x1f60e; <a href="$url">$title</a>\nЕженедельный подкаст от #Umputun'
preview: true
# Radio-t
- url : 'http://feeds.rucast.net/radio-t'
id : '@radiotnews'
format : '&#x1f47e; <a href="$url">$title</a>\nЕженедельные разговоры на темы хайтек, высоких компьютерных технологий, гаджетов, облаков, программирования и прочего интересного из мира ИТ. #radiot'
@shpaker
shpaker / calc_coords_distance.py
Created Aug 8, 2019
Calculate the distance between two GPS coordinates
View calc_coords_distance.py
import math
def calc_coords_distance(from_coords, to_coords):
"""
Calculate the distance between two GPS coordinates
*Example:*
```python
@shpaker
shpaker / keyboard_chars.md
Last active Aug 8, 2019
Special keys codes on the Mac keyboard
View keyboard_chars.md

Special keys codes on the Mac keyboard

Ch Hex Dec Description
&#x238B; &#9099; Esc
&#x23ce; &#9166; Enter
&#x2318; &#8984; Command
&#x2325; &#8997; Option
&#x2303; &#8963; Control
View gist:e3c95026e68edf59d136aad620705787
ENCRYPTED_PASSWORD=$(openssl passwd -crypt secure_password) && \
useradd --create-home \
--groups sudo \
--password ${ENCRYPTED_PASSWORD} \
user1
View gist:cb3862a6b4af0b2d077259131fe33a72
# 1
export USERNAME=${USER}
# 2
su root
# 3
apt update && apt install --yes sudo \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
View dplib.js
// Calc DPI with JS
function dpLib(debug) {
"use strict";
var div = document.createElement("div");
div.style.width = "1in";
div.style.position = "abolute";
div.style.top = "-100%";
div.style.bottom = "-100%";
document.body.appendChild(div);
//
@shpaker
shpaker / listener.py
Created Sep 27, 2017
Robot's listener v3 implementation
View listener.py
""" Robot's listener v3 implementation
For more information see:
http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#listener-version-3
"""
ROBOT_LISTENER_API_VERSION = 3
def start_suite(suite, result):
""" Called when a test suite starts.
@shpaker
shpaker / wifi_starter.cmd
Last active Jan 19, 2018
Batch file for managing virtual Wi-Fi hotspot in Windows 7+
View wifi_starter.cmd
rem author https://github.com/shpaker
@echo off
:main
echo [1] Start Wi-Fi network
echo [2] Stop Wi-Fi network
echo [3] Restart Wi-Fi network
echo [4] Config Wi-Fi network (require administrator privileges)
echo [0] Exit