Skip to content

Instantly share code, notes, and snippets.

View DjaPy's full-sized avatar
:octocat:
git

Sergey Ivanov DjaPy

:octocat:
git
  • Moscow
View GitHub Profile
@samv
samv / shell.py
Created August 13, 2012 19:38
A proposal for a SQLAlchemy Shell
"""
The SQLAlchemy Shell.
This is just a wrapper for code.InteractiveConsole with some useful
defaults for using SQLAlchemy
"""
import os
import sys
from code import InteractiveConsole
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@mosquito
mosquito / proxy.py
Last active May 5, 2022 05:25
AIOHTTP async proxy streaming
import platform
import unittest
from http import HTTPStatus
from urllib.parse import urlencode, unquote
import aiohttp
import asynctest
from aiohttp import web
from aiohttp.test_utils import TestClient
from multidict import MultiDict