- name: Display content of resolv.conf
hosts: localhost
tasks:
- name: Display resolv.conf contents
command: cat resolv.conf chdir=/etc
register: command_output
func Retry[T any](effector func(ctx context.Context) (T, error), retries int, delay time.Duration) func(context.Context) (*T, error) { | |
return func(ctx context.Context) (*T, error) { | |
for r := 0; ; r++ { | |
response, err := effector(ctx) | |
if err == nil || r >= retries { | |
// Return when there is no error or the maximum amount | |
// of retries is reached. | |
return &response, err | |
} |
from urllib.request import urlopen | |
from urllib.error import HTTPError | |
from concurrent.futures import ThreadPoolExecutor, as_completed | |
class HttpError(Exception): | |
def __init__(self, url: str, code: int) -> None: | |
self.url = url | |
self.code = code |
I want Microsoft to do better, want Windows to be a decent development platform-and yet, I constantly see Microsoft playing the open source game: advertising how open-source and developer friendly they are - only to crush developers under the heel of the corporate behemoth's boot.
The people who work at Microsoft are amazing, kind, talented individuals. This is aimed at the company's leadership, who I feel has on many occassions crushed myself and other developers under. It's a plea for help.
You probably haven't heard of it before, but if you've ever used win32 API bindings in C#, C++, Rust, or other languages, odds are they were generated from a repository called microsoft/win32metadata.
import sys | |
import time | |
def spinner(msg="working..."): | |
i = 0 | |
ticks = ["-", "\\", "|", "/"] | |
try: | |
while True: | |
tick = ticks[i % len(ticks)] |
import logging | |
import logging.handlers | |
import sys | |
# | |
# The logger and the logging level | |
# | |
logger = logging.getLogger('mylogger') | |
logger.setLevel(logging.DEBUG) |
# https://docs.python.org/3/library/typing.html#typing.Generator | |
# 💥💥💥 Simple generator: yield values one by one | |
# This function pauses to return a value to the outer scope, then proceeds | |
DICTIONARY = { | |
'a': 'apple', | |
'b': 'banana', | |
'c': 'cat', |
Run the following command on your terminal to install Homebrew. Homebrew is a package manager for Macs and is used to install useful development tools and software.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Run
brew install --cask anaconda
to install Anaconda
https://www.nerdfonts.com/font-downloads
The following solution thanks to @hackerzgz & @snacky101 will install all nerd fonts;
brew tap homebrew/cask-fonts
brew search '/font-.*-nerd-font/' | awk '{ print $1 }' | xargs -I{} brew install --cask {} || true