Skip to content

Instantly share code, notes, and snippets.

View mmngreco's full-sized avatar
:octocat:
Viming...

mg20400 mmngreco

:octocat:
Viming...
View GitHub Profile
@nkhitrov
nkhitrov / structlog_fastapi.py
Created March 16, 2023 00:04
Structlog FastAPI example
"""
Structlog example configuration with FastAPI.
Features:
- async bound logger
- contextvars to log request-id and other meta data
- custom format for default logging loggers and structlog loggers
"""
import asyncio
import logging
@MarcSkovMadsen
MarcSkovMadsen / panel_getting_started.py
Last active March 15, 2022 20:43
Panel - Getting Started .py Example
import numpy as np
import pandas as pd
from matplotlib.figure import Figure
data_url = "https://cdn.jsdelivr.net/gh/holoviz/panel@master/examples/assets/occupancy.csv"
data = pd.read_csv(data_url, parse_dates=["date"]).set_index("date")
primary_color = "#0072B5"
secondary_color = "#94EA84"
@avi-perl
avi-perl / df_to_table.py
Last active December 15, 2022 21:27
Convert a pandas.DataFrame object into a rich.Table object for stylized printing in Python.
from datetime import datetime
from typing import Optional
import pandas as pd
from rich import box
from rich.console import Console
from rich.table import Table
console = Console()
@matthewfeickert
matthewfeickert / README.md
Last active March 4, 2024 06:24
Motivation for using Python virtual environments for easy sharing

i3_Ricing

This is the repository containig the ricing configuration of the system. Please follow the steps of the README.md file in the repository to get the desired effect of ricing.

i3 is one of the most popular open source software that is used for ricing. 'Ricing' basically represents customizing desktop and enables multi-tasking tiling features and so on.

To install

$ sudo apt install i3
@tanaikech
tanaikech / submit.md
Created December 3, 2020 07:08
Sample Scripts for Creating New Event with Google Meet Link to Google Calendar using Various Languages

Sample Scripts for Creating New Event with Google Meet Link to Google Calendar using Various Languages

This is the sample scripts for creating new event with Google Meet link to Google Calendar using various languages. When I saw the official document of "Add video and phone conferences to events", in the current stage, I can see only the sample script for Javascript. But I saw the several questions related to this for various languages. So I published the sample scripts for creating new event with Google Meet link to Google Calendar using various languages.

In order to create new event with Google Meet link to Google Calendar, it is required to set the request body and query parameter as follows.

Please add the following object to the request body.

conferenceData: {
@eduardoarandah
eduardoarandah / instructions.md
Last active August 18, 2021 07:03
How to debug vim plugins or mappings

Create a file tmpvimrc with the following content

Add relevant plugins or mappings before or after plugins.

set nocompatible hidden laststatus=2

""""""""""""""""""""""""""""""""""
" PUT HERE YOUR MAPPINGS
""""""""""""""""""""""""""""""""""
@nkhitrov
nkhitrov / logger.py
Last active June 21, 2024 20:29
Configure uvicorn logs with loguru for FastAPI
"""
WARNING: dont use loguru, use structlog
https://gist.github.com/nkhitrov/38adbb314f0d35371eba4ffb8f27078f
Configure handlers and formats for application loggers.
"""
import logging
import sys
from pprint import pformat
@amacgregor
amacgregor / bspwmrc
Created May 19, 2020 17:08
Ubuntu 20.04 BSPWM + SXHD configuration
#!/bin/sh
# Configure the workspaces
for monitor in $(bspc query -M); do
bspc monitor $monitor -d 1 2 3 4 5 6 7 8 9
done
sxhkd &> /var/log/sxhkd.log &
bspc config border_width 1
@bewuethr
bewuethr / partial-rebase.md
Last active July 3, 2023 18:55
Partially rebasing a branch

Rebasing branches partially in Git

Situation

Feature branch feature1 is cut from development:

---o---o---o      <-- development
    \
 A---B---C &lt;-- feature1