Skip to content

Instantly share code, notes, and snippets.

View IaroslavR's full-sized avatar

Iaroslav Russkykh IaroslavR

View GitHub Profile
@IaroslavR
IaroslavR / Comparison Espressif ESP MCUs.md
Created December 5, 2022 18:45 — forked from fabianoriccardi/Comparison Espressif ESP MCUs.md
Comparison table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6

Comparison table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6

A minimal table to compare the Espressif's MCU families.

ESP8266 ESP32 ESP32-S2 ESP32-S3 ESP32-C3 ESP32-C6
Announcement Date 2014, August 2016, September 2019, September 2020, December
@IaroslavR
IaroslavR / README.md
Created December 21, 2019 13:11 — forked from M0r13n/README.md
Logging with Loguru in Flask

This is a simple example of how to use loguru in your flask application

Just create a new InterceptHandler and add it to your app. Different settings should be configured in your config file, so that it is easy to change settings.

Logging is then as easy as:

from loguru import logger

logger.info("I am logging from loguru!")

@IaroslavR
IaroslavR / compile-ffmpeg-nvenc.sh
Created November 5, 2018 04:17
This bash script will compile a static Ffmpeg build with NVENC and VAAPI hardware-accelerated support on Ubuntu in your home directory. You can modify the script to customize the build options as you see fit.
#!/bin/bash
#This script will compile and install a static ffmpeg build with support for nvenc un ubuntu.
#See the prefix path and compile options if edits are needed to suit your needs.
#install required things from apt
installLibs(){
echo "Installing prerequisites"
sudo apt-get update
sudo apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \
@IaroslavR
IaroslavR / whatsapp.py
Created August 31, 2018 14:30 — forked from deepak3081996/whatsapp.py
send whatsapp messages using python
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
def message(to,message=''):
"""this a simple function to send a whatsapp message to your friends
and group using python and selenium an automated tool to parse the HTML
content and to change the properties.
@IaroslavR
IaroslavR / README.md
Created May 7, 2018 17:12 — forked from datagrok/README.md
Circular imports in Python 2 and Python 3: when are they fatal? When do they work?

When are Python circular imports fatal?

In your Python package, you have:

  • an __init__.py that designates this as a Python package
  • a module_a.py, containing a function action_a() that references an attribute (like a function or variable) in module_b.py, and
  • a module_b.py, containing a function action_b() that references an attribute (like a function or variable) in module_a.py.

This situation can introduce a circular import error: module_a attempts to import module_b, but can't, because module_b needs to import module_a, which is in the process of being interpreted.

But, sometimes Python is magic, and code that looks like it should cause this circular import error works just fine!

@IaroslavR
IaroslavR / http-status-codes.md
Created March 8, 2018 00:09 — forked from subfuzion/http-status-codes.md
General REST API HTTP Status Codes

Reference: RFC 2616 - HTTP Status Code Definitions

General

  • 400 BAD REQUEST: The request was invalid or cannot be otherwise served. An accompanying error message will explain further. For security reasons, requests without authentication are considered invalid and will yield this response.
  • 401 UNAUTHORIZED: The authentication credentials are missing, or if supplied are not valid or not sufficient to access the resource.
  • 403 FORBIDDEN: The request has been refused. See the accompanying message for the specific reason (most likely for exceeding rate limit).
  • 404 NOT FOUND: The URI requested is invalid or the resource requested does not exists.
  • 406 NOT ACCEPTABLE: The request specified an invalid format.
@IaroslavR
IaroslavR / byobuCommands
Created September 6, 2017 10:57 — forked from jshaw/byobuCommands
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window
@IaroslavR
IaroslavR / 1.py
Created December 10, 2016 20:44 — forked from asvetlov/1.py
import asyncio
import aiohttp
async def f(sem, client, url):
async with sem:
with async_timeout.timeout(5):
async with client.get(url) as resp:
print(resp.status)
print(await resp.text()) # resp.context.read(1024)
@IaroslavR
IaroslavR / 00.howto_install_phantomjs.md
Created October 23, 2015 11:03 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev