Thanks to visit codestin.com
Credit goes to gist.github.com

Skip to content

Instantly share code, notes, and snippets.

View pszponder's full-sized avatar

Piotr Szponder pszponder

View GitHub Profile
@pszponder
pszponder / vscode_shortcuts.md
Last active September 5, 2025 05:11
Custom VSCode Shortcuts

VSCode Shortcuts

General

Command Name Keyboard Shortcut
Show Command Palette CTRL + SHIFT + p
Quick Open, Go to File... CTRL + p
Quick Open, Go to File... <LEADER> + f
Comment out line CTRL + /
@pszponder
pszponder / rest_api_client.py
Last active October 7, 2024 02:20
Simple Python REST Client for Reqres.in
"""
Just a simple Python REST Client example for reqres.in API for future reference
"""
import logging
import requests
# Configure the logger
logging.basicConfig(
@pszponder
pszponder / devcontainer.json
Created September 5, 2024 23:10
devcontainer for astronomer astro airflow project
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Airflow Dev Container",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile"
},
@pszponder
pszponder / manage_python_using_uv.md
Created August 21, 2024 22:07
How to use astral.sh uv to manage Python Project

How to use uv to manage a Python Project

Installing uv

Install uv

Initialize a Project

uv init
@pszponder
pszponder / VSCode Profile - Default
Last active July 21, 2024 03:40
VSCode Profiles
{"name":"Default","settings":"{\"settings\":\"{\\n // =============================================\\n // ================ GENERAL ====================\\n // =============================================\\n \\\"breadcrumbs.enabled\\\": true,\\n \\\"zenMode.hideLineNumbers\\\": false,\\n \\\"files.trimTrailingWhitespace\\\": true,\\n \\\"security.workspace.trust.untrustedFiles\\\": \\\"open\\\",\\n \\\"workbench.sideBar.location\\\": \\\"right\\\",\\n\\n // =============================================\\n // ================ EDITOR =====================\\n // =============================================\\n \\\"editor.fontSize\\\": 16,\\n \\\"editor.fontFamily\\\": \\\"'Cascadia Code NF', 'Liga ComicCode Nerd Font', SymbolsNerdFont\\\",\\n \\\"editor.fontLigatures\\\": \\\"'ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'ss07', 'ss08', 'calt', 'dlig', 'liga'\\\",\\n \\\"editor.lineNumbers\\\": \\\"relative\\\",\\n \\\"editor.renderWhitespace\\\": \\\"boundary\\\",\\n \\\"editor.wordWrap\\\": \
@pszponder
pszponder / Makefile
Last active July 21, 2024 03:50
Python Makefiles
# =========================
# Python Makefile using pip
# =========================
.ONESHELL:
# Define variables
VENV := .venv
BIN := $(VENV)/bin
PIP := $(BIN)/pip
@pszponder
pszponder / Dockerfile
Created January 25, 2024 05:50 — forked from usr-ein/Dockerfile
Optimal multistaged Dockerfile for poetry
# syntax=docker/dockerfile:1
# Keep this syntax directive! It's used to enable Docker BuildKit
# Based on https://github.com/python-poetry/poetry/discussions/1879?sort=top#discussioncomment-216865
# but I try to keep it updated (see history)
################################
# PYTHON-BASE
# Sets up all our shared environment variables
################################
@pszponder
pszponder / init.sh
Created December 18, 2023 04:00
Shell script to initialize a go project. To run, type chmod + x init.sh && ./init.sh
#!/usr/bin/env bash
# This script will create a new Golang project with a Makefile and some basic directories and files.
# It will also initialize a Git repository and make an initial commit.
# Use this script by running the following command: chmod +x init.sh && ./init.sh
# Get user input for the module path
read -p "Enter the module path (e.g., github.com/<username>/<project-name>): " module_path
# Create project directories
@pszponder
pszponder / Makefile
Last active December 18, 2023 03:50
Makefile for Go Project
# Makefile
# https://www.alexedwards.net/blog/a-time-saving-makefile-for-your-go-projects
# https://earthly.dev/blog/golang-makefile/
# target: dependencies
# action
# Variables
BINARY_DIR = ./bin
CMD_DIR = ./cmd
@pszponder
pszponder / env.ts
Created October 21, 2023 04:01
Parse and Validate .env File in TypeScript
// https://francoisbest.com/posts/2023/dotenv-is-dead?_hsmi=279178909
import { z } from 'zod'
const envSchema = z.object({
// TODO: CHANGE THESE TO MATCH YOUR CODE IMPLEMENTATION
// See https://cjihrig.com/node_env_considered_harmful
NODE_ENV: z.enum(['development', 'production', 'test']).default('production'),