Skip to content

Instantly share code, notes, and snippets.

🇺🇦@🇪🇺 building: GitHub🤖Bots @ansible@cherrypy🍒🥧 @aiohttp🔀 | using: @python🐍3.7

Sviatoslav Sydorenko webknjaz

🇺🇦@🇪🇺 building: GitHub🤖Bots @ansible@cherrypy🍒🥧 @aiohttp🔀 | using: @python🐍3.7
Block or report user

Report or block webknjaz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View py-spy-migrate-profile.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:9b7fe6dca3e04b942bf439fcaf2faf2f
Why do we have unadorned string literals (native strings) in our codebase?
Doesn't that put us in danger of UnicodeError exceptions?
(1) Your codebase should be using text by default. At the borders, you convert
strings from other APIs into text and then use text throughout, only
converting to bytes (or native strings) when those types are needed for
another, outside API.
(2) On Python2, text can be safely combined with (or compared to) text[1]_. Bytes
can be combined with bytes. And ascii-only bytes can be combined with text.
webknjaz /
Last active Aug 25, 2019 — forked from zacknawrocki/
CherryPy CORS issue
import cherrypy
import cherrypy_cors
class Coordinator:
def index(self):
return """<html>
<script type="text/javascript">
webknjaz /
Last active Aug 18, 2019 — forked from bmxp/
Doctype Bug
from pathlib import Path
import cherrypy
class Demo:
def index(self):
return Path('static/index.html').open(encoding='utf-8')
View github-event-bot-sender-example.json
"sender": {
"avatar_url": "",
"events_url": "{/privacy}",
"followers_url": "",
"following_url": "{/other_user}",
"gists_url": "{/gist_id}",
"gravatar_id": "",
"html_url": "",
"id": 49109000,
"login": "diactoros[bot]",
webknjaz /
Created Apr 20, 2019 — forked from PurpleBooth/
A template to make good

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


webknjaz / 51-android.rules
Last active Jan 29, 2019 — forked from jdamcd/51-android.rules
Full set of Android USB vendor ID rules for Linux
View 51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666", GROUP="plugdev", SYMLINK+="android%n" # Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="1949", MODE="0664", GROUP="plugdev", SYMLINK+="android%n" # Amazon
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666", GROUP="plugdev", SYMLINK+="android%n" # ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666", GROUP="plugdev", SYMLINK+="android%n" # Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666", GROUP="plugdev", SYMLINK+="android%n" # Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="04c5", MODE="0666", GROUP="plugdev", SYMLINK+="android%n" # Fujitsu
SUBSYSTEM=="usb", ATTR{idVendor}=="04c5", MODE="0666", GROUP="plugdev", SYMLINK+="android%n" # Fujitsu Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="091e", MODE="0666", GROUP="plugdev", SYMLINK+="android%n" # Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="0414", MODE="0666", GROUP="plugdev", SYMLINK+="android%n" # Gigabyte
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev", SYMLINK+="and
import functools
import collections
import cherrypy
__metaclass__ = type # enable new-style classes by default
class SelectedMethod:
webknjaz /
Created Sep 12, 2018 — forked from ryanj/
Gist-powered Revealjs slideshow presentations
<section data-background-transition='zoom' data-transition='concave' data-background='' data-state='blackout'>
<h2>Slideshow Presentations</h2>
<h1 class='fragment grow'><a style='color:deepskyblue;' href=''></a></h1>
<section data-background-transition='zoom' data-transition='linear' id='try-it'>
<h2>Try it out!</h2>
<p>Create your own deck by forking a copy of <a href=''>this github gist</a>: <br /><a href=''></a></p>
You can’t perform that action at this time.