Skip to content

Instantly share code, notes, and snippets.

View poteznyKrolik's full-sized avatar

mzajac poteznyKrolik

  • 01:08 (UTC -07:00)
View GitHub Profile
@carstencodes
carstencodes / .gitlab-ci.yml
Last active October 8, 2025 16:53
PDM (the Python Development Master) based approach to automatically update your dependencies in pdm.lock
# Instructions for gitlab are yet to come.

Postfix macros in Rust

The problem

Rust has many postfix combinators, for example the .unwrap_or(x) and .unwrap_or_else(|| x) functions. They are useful if you want to extract some value from an optionally present value, or if not, provide an alternative value. It's really nice and tidy to read:

@poteznyKrolik
poteznyKrolik / zipr.py
Created September 30, 2020 18:53 — forked from bbengfort/zipr.py
Dealing with Zip archives and json data in Python
#!/usr/bin/env python3
import os
import json
import random
import zipfile
config = {
"color": "red",
"amount": 42.24,
@poteznyKrolik
poteznyKrolik / schemacrawler-sqlite-macos-howto.md
Created September 18, 2020 22:28 — forked from dannguyen/schemacrawler-sqlite-macos-howto.md
How to use schemacrawler to generate schema diagrams for SQLite from the commandline (Mac OS)
@bbengfort
bbengfort / zipr.py
Last active December 5, 2021 01:34
Dealing with Zip archives and json data in Python
#!/usr/bin/env python3
import os
import json
import random
import zipfile
config = {
"color": "red",
"amount": 42.24,
@Austcool-Walker
Austcool-Walker / .zshrc
Last active October 3, 2023 21:38
My zshrc file.
# Filename: /etc/zsh/zshrc
# Purpose: config file for zsh (z shell)
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
################################################################################
# This file is sourced only for interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
@FBosler
FBosler / code.py
Created February 21, 2020 18:43
functools.py
from functools import lru_cache
from datetime import datetime
@lru_cache(maxsize=None)
def fib_cache(n):
if n < 2:
return n
return fib_cache(n-1) + fib_cache(n-2)
def fib_no_cache(n):
@jnolis
jnolis / 3-legged-twitter-auth-lite.R
Last active August 7, 2021 19:30
Do 3-legged Twitter authentication for rtweet (lite version)
# _____ __ __
# |__ / / /__ ____ _____ ____ ____/ /
# /_ <______/ / _ \/ __ `/ __ `/ _ \/ __ /
# ___/ /_____/ / __/ /_/ / /_/ / __/ /_/ /
# /____/ /_/\___/\__, /\__, /\___/\__,_/
# /____//____/
# RTWEET + 3-LEGGED-AUTH DEMO (LITE)
# This code demonstrates how to do 3-legged authentication for Twitter
# using the {rtweet} package. Based heavily on code from Michael Kearney.
@simrat39
simrat39 / pop_install.md
Last active February 3, 2024 06:51
Photoshop CC 2018 on Pop!_OS/Ubuntu Installation Guide

Photoshop CC 2018 on Pop!_OS installation guide

1 . Install Wine

Enable 32 bit architecture:

sudo dpkg --add-architecture i386
# https://hakibenita.com/fast-load-data-python-postgresql
from typing import Iterator, Dict, Any, Optional
from urllib.parse import urlencode
import datetime
#------------------------ Profile
import time