Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lukicdarkoo
lukicdarkoo / configure.sh
Created July 30, 2019 09:32
USB OTG Console for Armbian
sudo su
echo 'g_serial' >> etc/modules
echo 'ttyGS0' >> etc/securetty
echo 'echo 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role' > etc/init.d/otg_config.sh
chmod +x etc/init.d/otg_config.sh
@viksit
viksit / async_flask.py
Created March 28, 2016 20:01 — forked from sergray/async_flask.py
Asynchronous requests in Flask with gevent
"""Asynchronous requests in Flask with gevent"""
from time import time
from flask import Flask, Response
from gevent.pywsgi import WSGIServer
from gevent import monkey
import requests
@gregvish
gregvish / chat.py
Last active February 8, 2025 00:02
Python 3.4 asyncio chat server example
from socket import socket, SO_REUSEADDR, SOL_SOCKET
from asyncio import Task, coroutine, get_event_loop
class Peer(object):
def __init__(self, server, sock, name):
self.loop = server.loop
self.name = name
self._sock = sock
self._server = server
Task(self._peer_handler())