Skip to content

Instantly share code, notes, and snippets.

View peshala-prabhapoorna's full-sized avatar

Peshala Prabhapoorna peshala-prabhapoorna

View GitHub Profile
@liviaerxin
liviaerxin / README.md
Last active January 21, 2026 02:47
FastAPI and Uvicorn Logging #python #fastapi #uvicorn #logging

FastAPI and Uvicorn Logging

When running FastAPI app, all the logs in console are from Uvicorn and they do not have timestamp and other useful information. As Uvicorn applies python logging module, we can override Uvicorn logging formatter by applying a new logging configuration.

Meanwhile, it's able to unify the your endpoints logging with the Uvicorn logging by configuring all of them in the config file log_conf.yaml.

Before overriding:

uvicorn main:app --reload
@aradalvand
aradalvand / DockerfileForSvelteKit.md
Last active December 7, 2025 06:39
Dockerfile and .dockerignore for SvelteKit:

*This Dockerfile is intended for SvelteKit applications that use adapter-node. So, the Dockerfile below assumes that you have already installed and configured the adapter.

Dockerfile:

FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN npm run build
@zastrow
zastrow / Unbuttonize Mixin.scss
Last active May 15, 2025 22:06
Remove Default Button Styles
@mixin unbuttonize {
// This removes styles added by default to button elements.
// For when something should semantically be a button,
// but isn't buttony in appearance.
background-color: transparent;
border: none;
margin: 0;
padding: 0;
text-align: inherit;
font: inherit;
@airyboy
airyboy / console.log.js
Last active January 17, 2025 13:13
Redirecting console.log output to a webpage
<pre id="log"></pre>
(function(){
var oldLog = console.log;
console.log = function (message) {
const logger = document.getElementById('log');
logger.innerHTML += `> ${message}\n`;
oldLog.apply(console, arguments);
};