Skip to content

Instantly share code, notes, and snippets.

View btel's full-sized avatar
💡
open to freelance opportunities

Bartosz Telenczuk btel

💡
open to freelance opportunities
View GitHub Profile
@btel
btel / config.json
Created October 14, 2022 11:45
PeS bootstrap config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#00acaf",
@btel
btel / README.md
Last active June 18, 2021 15:59
testing mutliprocessing pool with path hooks

sys.path_hooks are not respected by multiprocessing when start mode is 'spawn' (default on Windows). However this works on Linux:

To test:

git clone https://gist.github.com/ec53217c41f965ffd6080a2632e9f944.git
cd ec53217c41f965ffd6080a2632e9f944
python test_pathtomodule.py
@btel
btel / README.md
Created November 19, 2020 12:50
testing race conditions in quetz create_version

Insert concurrenlty package versions in quetz DB

Test with:

python test_lock.py

(runs with sqlite)

or

# export the key created with the new quetz deployment (user bob)
export QUETZ_API_KEY=4f3f9c7fd6fb472c923ce27b676f6e21
# create channel
curl -X POST "http://localhost:8000/api/channels" -H "X-API-Key: ${QUETZ_API_KEY}" -d '{"name": "test-channel", "private": true}'
# -> null
# list packages without key - permission denied
curl http://localhost:8000/api/channels/test-channel/packages
# {"detail":"Not logged in"}
@btel
btel / steps.sh
Last active October 1, 2020 19:31
quetz-segfault-steps
# get package files from git
git clone https://github.com/mamba-org/quetz.git
cd quetz
# start quetz without reload
quetz run test_quetz_test12 --dev --copy-conf dev_config.toml
export QUETZ_API_KEY=...
curl -X POST "http://localhost:8000/api/channels" \
Thread 1 "xpython" received signal SIGSEGV, Segmentation fault.
0x00007f86acca8862 in _ZN8pybind1121polymorphic_type_hookIN4xeus16xhistory_managerEvE3getEPKS2_RPKSt9type_info () at /home/bartosz/.pyenv/versions/miniconda3-latest/envs/xeus-new/include/pybind11/cast.h:847
847 type = src ? &typeid(*src) : nullptr;
(gdb) bt
#0 0x00007f86acca8862 in _ZN8pybind1121polymorphic_type_hookIN4xeus16xhistory_managerEvE3getEPKS2_RPKSt9type_info () at /home/bartosz/.pyenv/versions/miniconda3-latest/envs/xeus-new/include/pybind11/cast.h:847
#1 src_and_type (src=0x7f86abd98bb0)
at /home/bartosz/.pyenv/versions/miniconda3-latest/envs/xeus-new/include/pybind11/cast.h:880
#2 cast (parent=..., policy=<optimized out>, src=0x7f86abd98bb0)
at /home/bartosz/.pyenv/versions/miniconda3-latest/envs/xeus-new/include/pybind11/cast.h:899
#3 _ZZN8pybind1112cpp_function10initializeIRKZN4xpyt22get_kernel_module_implEvEUlRNS2_18xinteractive_shellEE_PKN4xeus16xhistory_managerEJS4_EJEEEvOT_PFT0_DpT1_EDpRKT2_ENKUlRNS_6detail13
import zmq
import random
import time
raw_input = input
context = zmq.Context()
# Socket to send messages on
sender = context.socket(zmq.ROUTER)
{
"extensions": {
"jupyter_dashboards": {
"version": 1,
"views": {
"grid_default": {
"col": 0,
"height": 15,
"hidden": false,
"row": 9,
@btel
btel / draggable_table.ipynb
Created April 11, 2019 15:41
draggable_table
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
model = ols('no2~trafic+seasons',combined_data)