Skip to content

Instantly share code, notes, and snippets.

View olliegardner's full-sized avatar
💭
learning new things

Ollie olliegardner

💭
learning new things
View GitHub Profile
@AlwxSin
AlwxSin / views.py
Created October 27, 2017 11:01
Get current user by endpoint `/api/users/me` in DjangoRestFramework
from rest_framework import viewsets
from rest_framework.request import Request
from rest_framework.response import Response
class UserViewSet(viewsets.ModelViewSet):
def retrieve(self, request: Request, *args, **kwargs):
"""
If provided 'pk' is "me" then return the current user.
"""
if kwargs.get('pk') == 'me':
@lopspower
lopspower / README.md
Last active May 3, 2024 13:26
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store