Skip to content

Instantly share code, notes, and snippets.

View WaylonWalker's full-sized avatar
💌
waylonwalker.com/newsletter

Waylon Walker WaylonWalker

💌
waylonwalker.com/newsletter
View GitHub Profile
@WaylonWalker
WaylonWalker / dynamic_pydantic_models.py
Last active March 15, 2023 17:38
The idea is to make pluggable pydantic models where other libs can have config within a libraries config, and be type checked.
from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel, create_model, validator
import toml
class User(BaseModel):
id: int
name = "John Doe"
@YoEight
YoEight / improve_fonts.md
Created January 15, 2021 10:11 — forked from j1cs/improve_fonts.md
Improve fonts archlinux

Improve Fonts

Newest

Make your Arch fonts beautiful easily! This is what I do when I install Arch Linux to improve the fonts.

You may consider the following settings to improve your fonts for system-wide usage without installing a patched font library packages (eg. Infinality):

Install some fonts, for example:
sudo pacman -S ttf-dejavu ttf-liberation noto-fonts

@bradmontgomery
bradmontgomery / context.py
Created February 15, 2016 22:54
simple examples of a context manager in python
"""
Simple example of building your own context manager.
Resources:
- http://preshing.com/20110920/the-python-with-statement-by-example/
- https://docs.python.org/3/library/contextlib.html
- PEP 343 -- the "with" statement: https://www.python.org/dev/peps/pep-0343/
"""
@revolunet
revolunet / python-es6-comparison.md
Last active April 22, 2024 19:22
# Python VS JavaScript ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math
@dannycroft
dannycroft / exclude-node-modules
Last active February 27, 2019 18:25
Exclude node_modules out of Sublime Text 2 searches
// Add the following to your preferences file
"folder_exclude_patterns":[".git","node_modules"]

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream