Skip to content

Instantly share code, notes, and snippets.

@mmellison
mmellison / grpc_asyncio.py
Last active August 6, 2024 01:23
gRPC Servicer with Asyncio (Python 3.6+)
import asyncio
from concurrent import futures
import functools
import inspect
import threading
from grpc import _server
def _loop_mgr(loop: asyncio.AbstractEventLoop):
@inadarei
inadarei / minikube-sierra.md
Last active October 20, 2020 01:57
Minikube Setup: Docker for Mac / Sierra

Prerequisite: latest Docker for Mac on MacOS Sierra

$ brew update
$ brew install --HEAD xhyve
$ brew install docker-machine-driver-xhyve
$ sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.18.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
@mdellavo
mdellavo / taskpool.py
Created April 24, 2017 00:28
asyncio task pool
import asyncio
from asyncio.queues import Queue
TERMINATOR = object()
class TaskPool(object):
def __init__(self, loop, num_workers):
self.loop = loop
self.tasks = Queue(loop=self.loop)
@jchandra74
jchandra74 / PowerShell Customization.md
Last active January 8, 2025 09:35
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@veuncent
veuncent / docker_debugging.md
Last active February 21, 2024 00:58
Debugging Django apps running in Docker using ptvsd - Visual Studio (Code)

Remote debugging in Docker (for Django apps)

In order to enable debugging for your Django app running in a Docker container, follow these steps using Visual Studio (Code):

  1. Add ptvsd to your requirements.txt file
ptvsd == 4.3.2
  1. To your launch.json, add this:
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active April 20, 2025 19:36
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@shyamjos
shyamjos / kodi
Last active November 7, 2019 15:24
kodi upstart script , Start kodi automatically with raspbian boot. Tutorial https://linuxsuperuser.com/install-latest-version-kodi-raspbian-jessie/
#! /bin/sh
### BEGIN INIT INFO
# Provides: kodi
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: XBMC media centre
# Description: Starts the XBMC media centre in standalone mode
### END INIT INFO
@FirefighterBlu3
FirefighterBlu3 / wampcams.py
Created January 19, 2017 23:14
free threaded WAMP client that runs separate from any main process
#!/usr/bin/env python
__version__ = '1.5'
__released__ = '2016-Jul-6 12:50A EST'
__author__ = '[email protected]'
__license__ = 'Apache 2.0'
import asyncio
import configparser
import sys
@tomgross
tomgross / check_coverage.py
Last active April 10, 2019 14:33
Check the coverage of Python tests and compare with previous run in gitlab
# This script checks the coverage and test if it keeps at least the same
# Add this to your .gitlab-ci.yml
#
# coveragetest:
# ...
# cache:
# paths:
# - coverage_value.txt
# script:
# - bin/coverage run bin/test
@luc0
luc0 / js - knex_bulkupdate
Last active November 24, 2019 08:36
Node.js ( knex / bootshelf helper)
'use strict';
/*
CUSTOM METHODS TO EXTEND ORM
*/
module.exports = {
/*
var instance = new orm.bulkUpsert({
knex: knex,
model: 'modelName',