Skip to content

Instantly share code, notes, and snippets.

View tzelleke's full-sized avatar

Theodros Zelleke tzelleke

View GitHub Profile
@noraj
noraj / gulp-cjs-to-esm.md
Last active May 14, 2024 17:07
Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)

Moving gulpfile from CommonJS (CJS) to ECMAScript Modules (ESM)

Context

del v7.0.0 moved to pure ESM (no dual support), which forced me to move my gulpfile to ESM to be able to continue to use del.

The author sindresorhus maintains a lot of npm packages and does not want to provides an upgrade guide for each package so he provided a generic guide. But this guide is a bit vague because it's generic and not helping for gulp, hence this guide.

Guide

@nntrn
nntrn / espn-api-list.md
Last active May 30, 2024 05:29
List of nfl api endpoints from espn

List of NFL API Endpoints

This page has been updated a lot in the past 3 years. Older revisions you might like more than this one:

  • June 2021 - list of endpoints for other sports/leagues (i.e. basketball, baseball, lacrosse, rugby)
  • August 2021 - get historical fantasy league data
  • September 2021 - list of endpoints in plain text
  • May 2023 - collapsed endpoint response examples

Additional Resources

@glenfant
glenfant / a_G_for_FastAPI.md
Last active April 10, 2024 20:17
A simple POC that mimics in FastAPI the "g" request lifecycle pseudo global

Like Flask "g". Good news you can do the same with FastAPI

"g" is a threadlocal magic object that lets developer add / change / remove attributes during the request lifecycle. Learn more about this "g" here.

There is no OTB equivalent in FastAPI, but thanks to the new contextvars Python 3.7+ module, I made this simple demo.

Any comment or help to improve yhis recipe is welcome.

@bcherny
bcherny / designing-data-intensive-application-notes.md
Last active May 5, 2024 19:57
Notes: Designing Data-Intensive Applications

Notes on Martin Kleppmann's excellent Designing Data-Intensive Applications.

Chapter 1: Reliable, Scalable, and Maintainable Applications

  • Data Systems
    • Dimensions to consider when thinking about data systems: access patterns, performance characteristics, implementations.
    • Modern data systems often blur the lines between databases, caches, streams, etc.
  • Reliability
    • Systems should perform the expected function at a given level of performance, and be tolerant to faults and user mistakes
  • Fault: One component of a system deviating from its spec. Prefer tolerating faults over preventing them (except for things like security issues). Faults stem from hardware failures, software failures, and human error (in a study, config errors caused most outages).
@Sherex
Sherex / wikijs-keycloak-config-guide.md
Last active March 20, 2024 09:25
A guide for configuring Keycloak as a authentication provider in WikiJS | https://wiki.js.org | Feature request for adding this to the docs: https://requarks.canny.io/wiki/p/keycloak-auth-docs-proposal-for-a-guide-written
@nkhitrov
nkhitrov / logger.py
Last active May 28, 2024 12:18
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
@danieldogeanu
danieldogeanu / RenameGitBranch.md
Last active May 31, 2024 02:56
How to rename your Git master branch to main.

To rename your Git master branch to main, you must do the following steps:

  1. Navigate to your repository in the command line and issue the following commands: - git branch -m master main - git push -u origin main

  2. Change your default branch on GitHub by going to your GitHub repository in your browser, and navigate to Settings > Branches and click on the dropdown and switch from master to main and click Update (this will only show if you have two or more branches). The main branch is now your default branch.

  3. Update the tracking of the branch from your command line with the following command: - git branch -u origin/main main

@taichikuji
taichikuji / README.md
Last active May 24, 2024 09:33
Get a DDNS up and running with DuckDNS - Step by Step

Get a DDNS up and running with DuckDNS - Step by Step

DDNS? What is that?

A dynamic DNS. DNS stands for Domain Name Server, which, in other words, is basically the server that answer your queries when you search for a hostname on the internet.

Example: If you search for "google.com" there will always (probably) a server that points out to that hostname and tells you the information the computer needs; the IP address.

If you want to give it a test, you only have to open your terminal and type "ping google.com" and you will see the real IP address appear! In my case it's 216.58.201.174 .

Anyways.. A DDNS is useful if you want to link or put a hostname to an IP that is not STATIC.

@alvarocavalcanti
alvarocavalcanti / Dockerfile.dev
Last active April 28, 2024 19:41
Configuring Python Remote Interpreter using Docker
FROM python:3.7
ENV PYTHONUNBUFFERED 1
WORKDIR /code
# Copying the requirements, this is needed because at this point the volume isn't mounted yet
COPY requirements.txt /code/
# Installing requirements, if you don't use this, you should.
# More info: https://pip.pypa.io/en/stable/user_guide/