Skip to content

Instantly share code, notes, and snippets.

View DzeryCZ's full-sized avatar
🎸

Jaroslav Živný DzeryCZ

🎸
  • ErsteBank
  • Vienna
View GitHub Profile
@katzefudder
katzefudder / Dockerfile
Last active December 6, 2022 07:44
AWS CLI dockerized with Alpine Linux
FROM alpine:3.14
ENV AWSCLI_VERSION "1.20.7"
RUN apk add --update \
python3 \
python3-dev \
py-pip \
build-base \
&& pip install awscli==$AWSCLI_VERSION --upgrade --user \
@azylinski
azylinski / uuid.py
Created October 12, 2017 22:36
Get uuid from Python dict.
from json import JSONEncoder, dumps
from datetime import date, datetime
from uuid import NAMESPACE_DNS, uuid3
class DateTimeEncoder(JSONEncoder):
def default(self, obj):
if isinstance(obj, (date, datetime)):
return obj.isoformat()
@ololobus
ololobus / create-and-fill-up-table.sql
Last active July 27, 2024 07:12
Create large ~1 GB random dataset in PostgreSQL
CREATE TABLE large_test (num1 bigint, num2 double precision, num3 double precision);
INSERT INTO large_test (num1, num2, num3)
SELECT round(random()*10), random(), random()*142
FROM generate_series(1, 20000000) s(i);
EXPLAIN (analyse, buffers)
SELECT num1, avg(num3) as num3_avg, sum(num2) as num2_sum
FROM large_test
GROUP BY num1;