Skip to content

Instantly share code, notes, and snippets.

@antnieszka
antnieszka / Exclude_tables.md
Created August 18, 2020 12:09 — forked from utek/Exclude_tables.md
Define ignored tables in alembic.ini

Add this in your ini file:

[alembic:exclude]
tables = spatial_ref_sys

In env.py:

def exclude_tables_from_config(config_):
    tables_ = config_.get("tables", None)

if tables_ is not None:

@antnieszka
antnieszka / async_websocket.py
Last active December 12, 2019 19:02
Async websocket server with rabbit consumer
#!/usr/bin/env python3
import itertools
import os
import random
import aio_pika
import asyncio
import logging
import websockets
@antnieszka
antnieszka / temporary_venv.py
Created November 1, 2019 22:36
Create python venv and install dependencies in temp dir
import os
import tempfile
import subprocess
dependencies = """
flake8
black
""".strip()
# create temporary directory for venv
@antnieszka
antnieszka / fields.py
Created May 14, 2018 20:15
EnglishURLField
from django.db.models import CharField
from django.utils.text import slugify
import logging
logger = logging.getLogger(__name__)
class EnglishURLField(CharField):
def __init__(self, *args, **kwargs):
@antnieszka
antnieszka / gulpfile.js
Created March 12, 2018 20:26
Simple gulpfile for django projects
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
gulp.task('default', function () {
browserSync.init({
notify: true,
proxy: "localhost:8000",
ghostMode: false,
reloadDebounce: 500

Keybase proof

I hereby claim:

  • I am ant6 on github.
  • I am ant6 (https://keybase.io/ant6) on keybase.
  • I have a public key ASDhM29FBMjXFGk4GmzDWF2OPguwR1Wxw8Yn7HSTxq0SkQo

To claim this, I am signing this object:

>>> t = getattr(mcpartools.scheduler.torque, "Torque")
>>> t
<class 'mcpartools.scheduler.torque.Torque'>
>>> b
'torque'
>>> b.title()
'Torque'
>>> t = getattr(mcpartools.scheduler.torque, b.title())
>>> t.__name__
'Torque'
import numpy as np
import scipy.optimize
import beprof.profile
import logging
# logging = logging.getLogger()
# logging.setLevel(30)
# nbps = 3
# TO2 - projekt?
TO2 = False
with open("1-department-list.csv", "r", encoding="utf8") as depart_in:
przedmioty = ()
studenciaki = {}
temp_student = ""
for e in depart_in.readlines():
if e[0] != '\t': # pewno student
temp_student = e.strip().split(";")[0]
(beprof3){16-07-02 18:49} ~/Downloads ant6% ➜ rm -fr beprof
(beprof3){16-07-02 18:49} ~/Downloads ant6% ➜ git clone https://github.com/ant6/beprof.git
Cloning into 'beprof'...
remote: Counting objects: 654, done.
remote: Total 654 (delta 0), reused 0 (delta 0), pack-reused 654
Receiving objects: 100% (654/654), 155.03 KiB | 174.00 KiB/s, done.
Resolving deltas: 100% (366/366), done.
Checking connectivity... done.
(beprof3){16-07-02 18:49} ~/Downloads ant6% ➜ cd beprof
(beprof3){16-07-02 18:49} ~/Downloads/beprof@master ant6% ➜ python setup.py develop