Skip to content

Instantly share code, notes, and snippets.

cattrs

         4383229 function calls (4132429 primitive calls) in 3.026 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
150000/25000    0.920    0.000    1.651    0.000 converters.py:195(unstructure_attrs_asdict)
150000/25000    0.687    0.000    1.290    0.000 converters.py:294(structure_attrs_fromdict)
@zeburek
zeburek / expected_conditions.py
Created November 20, 2019 11:53
Wait for browser requests using pure JS and Python
from selenium.common.exceptions import (
WebDriverException,
)
class number_of_all_elements_located(object):
""" An expectation for checking that there is at least given number of
elements present on a web page.
locator is used to find the element
returns the list of WebElements once they are located

Backup Drive MBR & Partition Table:

In terminal type dd if=/dev/sda of=/media/location/backup.img bs=512 count=1.

Restore Drive MBR:

In terminal type dd if=/media/location/backup.img of=/dev/sda bs=446 count=1.

Backup Partition MBR & Partition Table:

@zeburek
zeburek / api.md
Last active May 2, 2024 20:13
Чек-лист проверок API

Чек-лист API тестов

  • Корректность структуры данных
  • POST запросы
    • Заполнены все поля валидными данными
    • Заполнены только обязательные поля
    • Заполнены не все обязательные поля
    • Не заполнено ни одно поле
    • Валидация данных в полях (корректные и некорректные данные)
    • Пустой JSON
  • Дата создания объекта
:: start sqlcm
@echo off
COLOR 06
cls
echo.
echo.
:start
echo 1. Scan - 1
echo 2. Exit - 2
set /p choice= Input number:
@zeburek
zeburek / game.sol
Created March 30, 2019 08:29
Smart-contract for game Stone Paper Scissors
pragma solidity >=0.4.18;
contract StonePaperScissors{
enum VARIANTS {STONE, PAPER, SCISSORS}
enum WINNER {DRAW, USER, COMP}
mapping (uint => mapping(uint => int)) winLooseMatrix;
uint nonce = 132;
uint houseEdge = 1;
address player;
uint playerChoice;
@zeburek
zeburek / HawkAuth.scala
Created October 1, 2018 11:35
An example of SignatureCalculator for Gatling 2.3.1
package test.utils
import java.net.URI
import test.Test
import org.asynchttpclient.{Request, RequestBuilderBase, SignatureCalculator}
class HawkAuth extends SignatureCalculator {
override def calculateAndAddSignature(request: Request, requestBuilder: RequestBuilderBase[_]): Unit = {