Skip to content

Instantly share code, notes, and snippets.

View md-redwan-hossain's full-sized avatar
💻
Open For Work

Md. Redwan Hossain md-redwan-hossain

💻
Open For Work
  • 22:54 (UTC +06:00)
View GitHub Profile
@shreyansb
shreyansb / flask_profiler.py
Last active January 11, 2024 12:08
A profiler for Flask apps
"""
This module provides a simple WSGI profiler middleware for finding
bottlenecks in web application. It uses the profile or cProfile
module to do the profiling and writes the stats to the stream provided
To use, run `flask_profiler.py` instead of `app.py`
see: http://werkzeug.pocoo.org/docs/0.9/contrib/profiler/
and: http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvi-debugging-testing-and-profiling
"""
@mandiwise
mandiwise / Count lines in Git repo
Last active September 29, 2024 19:44
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
"""Extract nested values from a JSON tree."""
def json_extract(obj, key):
"""Recursively fetch values from nested JSON."""
arr = []
def extract(obj, arr, key):
"""Recursively search for values of key in JSON tree."""
if isinstance(obj, dict):
@cmh114933
cmh114933 / _redirects
Last active June 28, 2024 22:56
Enable Angular Routing on Netlify
/* /index.html 200
@paulonteri
paulonteri / model_viewset.py
Created August 24, 2020 13:13
Override list method in DRF ModelViewSet
# Students View
class StudentViewSet(viewsets.ModelViewSet):
queryset = Student.objects.all()
serializer_class = StudentSerializer
permission_classes = perms
def list(self, request, *args, **kwargs):
queryset = Student.objects.all().only("student_id", "first_name", "surname", "gender", "class_ns", "dormitory")
serializer = StudentLessDataSerializer(queryset, many=True)
return Response(serializer.data)
@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

@SubhanRaj
SubhanRaj / Laravel-Mix-Live-Reload.md
Last active April 25, 2024 14:11
This gist provides the steps to enable live reload of a Laravel project using Laravel Mix and BrowserSync.

How to enable Live Reload of a Laravel Project Using Laravel Mix & BrowserSync

You can follow the steps below to enable live reload of a Laravel project using Laravel Mix and BrowserSync.

Important

You need to have Node.js installed on your machine to use Laravel Mix. If you don't have Node.js installed, you can download it from here.

Steps to enable live reload of a Laravel project using Laravel Mix and BrowserSync: