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
@webknjaz
webknjaz / result_taskgroup.py
Created Feb 9, 2020 — forked from smurfix/result_taskgroup.py
anyio ResultGatheringTaskgroup
View result_taskgroup.py
import anyio
from contextlib import asynccontextmanager
class NotYet(RuntimeError):
pass
class ResultGatheringTaskgroup:
def __init__(self):
self.result = []
@webknjaz
webknjaz / runs-on: ubuntu-latest.txt
Created Jan 31, 2020 — forked from sonots/runs-on: ubuntu-latest.txt
Environment Variables on Github Actions
View runs-on: ubuntu-latest.txt
GOROOT_1_11_X64=/usr/local/go1.11
ANDROID_HOME=/usr/local/lib/android/sdk
JAVA_HOME_11_X64=/usr/lib/jvm/zulu-11-azure-amd64
ImageVersion=20190930.2
LANG=C.UTF-8
INVOCATION_ID=029524e610de4329ac57a8f3e8b21281
JAVA_HOME_12_X64=/usr/lib/jvm/zulu-12-azure-amd64
ANDROID_SDK_ROOT=/usr/local/lib/android/sdk
RUNNER_TOOL_CACHE=/opt/hostedtoolcache
JAVA_HOME=/usr/lib/jvm/zulu-11-azure-amd64
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
webknjaz / coordinator.py
Last active Aug 25, 2019 — forked from zacknawrocki/coordinator.py
CherryPy CORS issue
View coordinator.py
import cherrypy
import cherrypy_cors
class Coordinator:
@cherrypy.expose
def index(self):
return """<html>
<script type="text/javascript">
@webknjaz
webknjaz / Demo.py
Last active Aug 18, 2019 — forked from bmxp/Demo.py
Doctype Bug
View Demo.py
from pathlib import Path
import cherrypy
class Demo:
@cherrypy.expose
def index(self):
return Path('static/index.html').open(encoding='utf-8')
View github-event-bot-sender-example.json
"sender": {
"avatar_url": "https://avatars0.githubusercontent.com/u/40318227?v=4",
"events_url": "https://api.github.com/users/diactoros%5Bbot%5D/events{/privacy}",
"followers_url": "https://api.github.com/users/diactoros%5Bbot%5D/followers",
"following_url": "https://api.github.com/users/diactoros%5Bbot%5D/following{/other_user}",
"gists_url": "https://api.github.com/users/diactoros%5Bbot%5D/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/apps/diactoros",
"id": 49109000,
"login": "diactoros[bot]",
@webknjaz
webknjaz / README-Template.md
Created Apr 20, 2019 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

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.

Prerequisites

You can’t perform that action at this time.