Skip to content

Instantly share code, notes, and snippets.

@hound672
hound672 / .golangci.yml
Last active November 6, 2022 16:41
golangci-lint config
# Config for golangci-lint v1.50.0
# based on https://gist.github.com/maratori/47a4d00457a92aa426dbd48a18776322
run:
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 3m
go: '1.17'
sudo ip link add dummy0 type dummy
sudo ip addr add 192.168.100.100/24 dev dummy0
sudo ip link set dummy0 up
sudo ufw allow in on dummy0 to any port 8081:8086 proto tcp
@hound672
hound672 / dataclass_to_pydantic.py
Last active May 22, 2023 07:33
Dataclass to Pydantic BaseModel
import unittest
from typing import Any, Type
from dataclasses import dataclass, is_dataclass
from pydantic import BaseModel, ValidationError
from pydantic.main import MetaModel
AnyType = Type[Any]