Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -ex
pip_args=${@:-"--help"}
apk add --no-cache \
--virtual .build-deps \
gcc \
g++ \
make \
@roadsideseb
roadsideseb / async_schedule.py
Last active August 11, 2022 09:49
A slightly modified version of the 'schedule' Python package that works with asyncio 😎
import emoji
import schedule
import asyncio
import inspect
from datetime import datetime
class Job(schedule.Job):
@roadsideseb
roadsideseb / 01 🐍 load testing with gatling.md
Last active April 1, 2023 14:33
Load testing Python web apps with Gatling

Results

These results are generated by a gatling simulation that ramps 100 user over 10 second and then keeps the users constant at that rate for 60 seconds before ramping again by 100 users. The entire scenario runs from 0 to 1000 users.

Flask

@roadsideseb
roadsideseb / python_job_sites.md
Last active April 4, 2018 10:44
Job sites for Django and Python developers
@roadsideseb
roadsideseb / pyvideo_speaker_classification.ipynb
Last active December 12, 2016 18:50
Classification of Python conferences by men and women speaker based on pyvideo.org data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@roadsideseb
roadsideseb / auto_install_dmg.sh
Last active November 10, 2016 17:50
Various ways to install packages on OSX
#!/bin/bash
#
# Install an application or library that uses a PKG installer
# wrapped inside a DMG archive. Takes the URL of the DMG and
# optionally the name of the downloaded file locally.
#
# ./auto_install_dmg.sh https://example.com/software/download/super_genius_tool_v1.2.dmg
set -uxe
download_url=${1:-"https://google.com/"}
@roadsideseb
roadsideseb / py27_package_with_init.md
Last active December 9, 2016 19:24
Subtle difference between packages

Subtle differences in loading packages

PEP-420 is explaining the differences between regular packages and namespace packages: https://www.python.org/dev/peps/pep-0420/

Python 2.7

A package with a __init__.py:

my

The Rules of the Beer Fridge Trust

Rule #1

The beer frigde is a trust-based organism that will die if the trust is not nurtured.

Rule #2

Beer in the fridge is fair game to every member of the trust, unless explicitly labeled.

Rule #3

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@roadsideseb
roadsideseb / Makefile
Last active January 26, 2016 23:07
Deploying image to tutum.
.PHONY: deploy build static-upload
SHELL := /bin/bash
base_image := elbaschid/python-base
builder_image := elbaschid/django-builder
tester_image := elbaschid/django-tester
image := tutum.co/elbaschid/love-fear
image_version := $(shell python deployer.py bump_version)