Skip to content

Instantly share code, notes, and snippets.

View lukassup's full-sized avatar
🍕

Lukas Šupienis lukassup

🍕
  • Lithuania
View GitHub Profile

Python small object caching

The Python interpreter performs caching of some small objects.

Two small integers of the same value are also referring to the same object despite being instantiated independently.

>>> a = 1
>>> b = 1
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
R"""vilniustransport.lt public transport subscription card status viewer
Script depends on "requests" and "beautifulsoup4" Python packages, use:
$ pip install requests beautifulsoup4
to install them
  • If aufs is available, default to it, because it is the oldest storage driver. However, it is not universally available.
  • If possible, the storage driver with the least amount of configuration is used, such as btrfs or zfs. Each of these relies on the backing filesystem being configured correctly.
  • Otherwise, try to use the storage driver with the best overall performance and stability in the most usual scenarios.
    • overlay2 is preferred, followed by overlay. Neither of these requires extra configuration.
##
# ~/.tmux.conf
#
# Override the primary prefix
set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
##
# mpv v0.25 config
#
# ab-loop-a=no # Time
# ab-loop-b=no # Time
# access-references=yes # Flag
# ad= # String
# ad-lavc-ac3drc=0.000000 # Float (0 to 6)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import socket
import logging
import sys
log = logging.getLogger(__name__)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
##
# /etc/mkinitcpio.conf
#
# Intel GPU KMS
MODULES="intel_agp i915"
# ATI Radeon GPU KMS (open-source driver)
MODULES="radeon"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Datetime floor, ceiling and round utility functions."""
from datetime import datetime, timedelta
def datetime_floor(dt=None, delta=None, datetime=datetime, timedelta=timedelta):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Example module."""
def main():
print('Hello, world!')