Skip to content

Instantly share code, notes, and snippets.

View vmagamedov's full-sized avatar
💥
War time

Volodymyr Magamedov vmagamedov

💥
War time
View GitHub Profile
import asyncio
from contextvars import ContextVar
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter
from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import get_tracer, SpanKind
from opentelemetry.context import attach, detach
from opentelemetry.propagate import extract
@vmagamedov
vmagamedov / progress.tsx
Created February 28, 2023 18:31
nprogress alternative for showing page loading progress in SPA application
import { styled } from "@linaria/react";
import * as React from "react";
import { useLayoutEffect, useState } from "react";
import { useNavigation } from "react-router";
const Bar = styled.div<{ barPosition: number }>`
pointer-events: none;
opacity: ${(props) => (props.barPosition === 80 ? "1" : "0")};
position: fixed;
top: 0;