Skip to content

Instantly share code, notes, and snippets.

View orian's full-sized avatar

Paweł Szczur orian

View GitHub Profile
@orian
orian / weather-schema.sql
Last active August 1, 2022 13:26
simple schema for weather table
create table weather (longitude double not null,
latitude double not null,
time_ timestamp not null,
u10 double not null,
v10 double not null,
snow_density float not null,
snow_depth float not null,
snowfall float not null,
snowc double not null,
smlt double not null,
@orian
orian / mapping.py
Created February 17, 2025 23:35
add tz_sensitive info to HogQLFunctionMeta
@dataclass()
class HogQLFunctionMeta:
clickhouse_name: str
min_args: int = 0
max_args: Optional[int] = 0
min_params: int = 0
max_params: Optional[int] = 0
aggregate: bool = False
overloads: Optional[list[Overload]] = None
"""Overloads allow for using a different ClickHouse function depending on the type of the first arg."""
class TeamConcurrentThrottle(BaseThrottle):
def allow_request(self, request, view):
personal_api_key = PersonalAPIKeyAuthentication.find_key_with_source(request)
if request.user.is_authenticated and personal_api_key is None:
return True
team_id = PersonalApiKeyRateThrottle.safely_get_team_id_from_view(view)
if team_id is None:
return True
# Multi-stage Dockerfile for Darknet (CPU-only)
# Compiles Darknet from Codeberg repository for object detection
# docker build -f Dockerfile.darknet --tag darknet-cpu:latest
# Build stage
FROM ubuntu:24.04 AS builder
# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
@orian
orian / drop-event-properties.go
Created March 17, 2026 14:40
drop properties
package main
import (
"context"
"database/sql"
"encoding/json"
"flag"
"fmt"
"log"
"os"