Skip to content

Instantly share code, notes, and snippets.

View tbrlpld's full-sized avatar

Tibor Leupold tbrlpld

View GitHub Profile
@tbrlpld
tbrlpld / socketclient.py
Created April 23, 2020 03:17
Simple Python socket example
import socket
HOST = "127.0.0.1"
PORT = 5000
s = socket.socket()
s.connect((HOST, PORT))
# msg = str(input("Message -> "))
@tbrlpld
tbrlpld / abstract.py
Last active May 17, 2020 02:19
How to make sure you are only using the abstract interface of a concrete implementation.
# -*- coding: utf-8 -*-
"""
Defines the method patters the are supposed to be implemented in concrete.
There is no actual implementation here. This serves as a interface. The
consumer should use the concrete implementations only to the extend defined
here.
"""
@tbrlpld
tbrlpld / sphere.html
Created May 30, 2021 03:47
HTML CSS sphere doodle...
<div style="padding: 100px;background: rgb(11, 11, 11);">
<div style="background: white;border-radius: 9999px;width: 100px;height: 100px;margin: 50 auto;box-shadow: 12px -26px 27px 4px black inset, 5px -9px 33px -10px white;ack;ac;"></div>
</div>
@tbrlpld
tbrlpld / transfer-postgres-to-sqlite.sh
Created March 11, 2023 23:37
Transfer Django PostgreSQL to SQLite
# Bash "strict mode"
set -euo pipefail
IFS=$'\n\t'
echo "Transfer data from PostgreSQL to SQLite"
DUMP_FILE=$DB_DIR/dbdump.json
echo "Migrate SQLite database..."
USE_SQLITE=true ./manage.py migrate --no-input