Skip to content

Instantly share code, notes, and snippets.

View Gera3dartist's full-sized avatar
🏠
Working from home

Andrii Gerasymchuk Gera3dartist

🏠
Working from home
View GitHub Profile
@CasperCL
CasperCL / Pyramid.Dockerfile
Last active October 14, 2020 17:51
Docker for Pyramid
FROM python:3.6-alpine
RUN pip install gunicorn
COPY . /app
WORKDIR /app
RUN python setup.py develop
VOLUME ['/conf']
@samuelcolvin
samuelcolvin / aiohttp_vs_sanic.md
Created June 3, 2017 11:55
comparing aiohttp and sanic performance

Requirements

python 3.6, postgres, pip install aiohttp uvloop ujson asyncpg sanic

aiohttp & uvloop

➤ wrk -d 10 -c 100 -t 12 --timeout 8 http://localhost:8000  # aiohttp
Running 10s test @ http://localhost:8000
@mcchae
mcchae / index.py
Last active August 29, 2018 06:00
CVE search engine using python Whoosh
#!/usr/bin/env python
# coding=utf-8
"""
import CVE from "http://cve.mitre.org/data/downloads/allitems.txt"
"""
################################################################################
import os
import urllib2
import getopt
@augbog
augbog / Free O'Reilly Books.md
Last active July 23, 2024 15:24
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@JonCole
JonCole / Redis-BestPractices-General.md
Last active September 20, 2024 12:15
Redis Best Practices

Some of the Redis best practices content has moved

This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.

NOTE: Client specific guidance listed below is still valid and should still be considered. I will update this document once all content has been moved.

@chdorner
chdorner / README.md
Last active June 23, 2023 20:13
SQLAlchemy scan large table in batches

my database had 72k annotations at the time I ran these benchmarks, here's the result:

$ python scripts/batch_bench.py conf/development-app.ini dumb
Memory summary: start
      types |   # objects |   total size
=========== | =========== | ============
       dict |       13852 |     12.46 MB
  frozenset |         349 |     11.85 MB
VM: 327.29Mb
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@biggers
biggers / Dockerfile
Last active March 8, 2018 11:42
docker-compose build attempt for a Pyramid app
FROM phusion/baseimage:0.9.18
MAINTAINER biggers@utsl.com
ENV PYTHONUNBUFFERED 1
# ...put your own build instructions here...
RUN apt-get update --no-install-recommends && \
apt-get install -y --no-install-recommends \
# -*- coding: utf-8 -*-
from random import randint
import tornado.concurrent
import tornado.platform.asyncio
import tornado.web
from aiopg.sa import create_engine as aiopg_create_engine
import asyncio