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 May 7, 2026 22:11
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 March 7, 2026 19:09
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
@scmx
scmx / git-commit-title-first-word.md
Last active April 28, 2026 04:58
Example list of verbs / first word to use in git commit title #git #commit #title

Example list of first words to use in a git commit title

I like writing well-formed git commits that explain the intention behind why a code change was made.

Check out Chris Beams excellent How to Write a Git Commit Message if you haven't read it.

Anyway, for a project I've been working on I've gathered up 900+ commits that hold up a pretty high quality (except for one 😁). Let's look at some trends about these commits!

Most common first words in commit titles of a project

@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);
};