Skip to content

Instantly share code, notes, and snippets.

View kuldeepk's full-sized avatar

Kuldeep Kapade kuldeepk

  • UC Berkeley
  • San Francisco
View GitHub Profile
@georgevreilly
georgevreilly / sessionrecorder.py
Last active June 15, 2023 14:45
WSGI Middleware to record Request and Response data
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
WSGI middleware to record requests and responses.
"""
from __future__ import print_function, unicode_literals
import logging
@Bahus
Bahus / json_schemed_field.py
Last active May 30, 2024 23:47
Django JSONField with Pydantic schema support
from functools import partial
import pydantic
import logging
from django.contrib.postgres.fields import JSONField
from typing import Type, Union, Tuple
from django.core.serializers.json import DjangoJSONEncoder
@johanlef
johanlef / README.md
Last active July 7, 2024 03:24
Use CSS custom properties (--var) with bootstrap 4 (SCSS)

The file _functions-override.scss contains the custom functions to handle color conversions within sass and bootstrap.

Bootstrap does not like its sass variables set to css custom properties, e.g. var(--primary). If you use the code snippets below, you can do so, under some conditions.

In the most basic case, you should provide your color variables using the hsl format.

If you insert this using javascript, you can use the script apply-colors.jsx to let js handle the conversion from hex or rgb to hsl.

Reference the main.scss file to import the files in the correct order.