Skip to content

Instantly share code, notes, and snippets.

View mivade's full-sized avatar
👋

Mike DePalatis mivade

👋
View GitHub Profile
@mivade
mivade / aiowatch.py
Created October 26, 2018 17:00
Using watchdog with asyncio
import asyncio
from pathlib import Path
from typing import Optional
from watchdog.events import FileSystemEvent, FileSystemEventHandler
from watchdog.observers import Observer
class _EventHandler(FileSystemEventHandler):
def __init__(self, queue: asyncio.Queue, loop: asyncio.BaseEventLoop,
@mivade
mivade / zmq_auth.py
Last active December 30, 2023 12:57
ZeroMQ Curve authentication demo
"""Simple demonstration of using ZMQ's Curve authentication.
This demo is adapted from the examples given in the `PyZMQ repository`__. Key
differences include:
* Using ``setsockopt`` to set Curve parameters instead of setting attributes
directly (help out your IDE!)
* Integration with ``asyncio``
__ https://github.com/zeromq/pyzmq/tree/master/examples
"""Example of how to use webargs with Tornado to read form data which includes file uploads."""
from dataclasses import dataclass, field
from typing import List, Optional
from marshmallow_dataclass import class_schema
from marshmallow.fields import Raw
from tornado.ioloop import IOLoop
from tornado.web import Application, RequestHandler
@mivade
mivade / Set-Up-PowerShell-for-Python.md
Last active October 10, 2022 17:02 — forked from andrew-rietz/Set-Up-PowerShell-for-Python.md
Set Up PowerShell for Python

1. Install Scoop
Scoop is a command-line installer for Windows -- it's like Homebrew for Windows. It installs programs from the command line with a minimal amount of friction. More info about scoop is available here: https://gist.github.com/andrew-rietz/66e4ebcf96f85b6618b078ebe00104b1
To install, open PowerShell and execute the following command:

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

2. Use Scoop to install some awesome helper applications
We'll use Scoop to install a couple applications: posh-git and starship. Posh-git adds a lot of the convenience features you get in git bash directly into PowerShell (autocompletion, etc.). We'll also install starship.rs: a customizeable prompt for many of the common shells (Bash, Fish, Zsh, PowerShell).

@mivade
mivade / docker-wsl-ubuntu.md
Created May 4, 2023 14:53
Installing Docker in Ubuntu on WSL

Installing Docker in Ubuntu on WSL

Install upstream Docker

Follow the instructions here

Start the service and troubleshoot problems

sudo service docker start