Skip to content

Instantly share code, notes, and snippets.

View icereval's full-sized avatar
🐈

Michael Haselton icereval

🐈
View GitHub Profile
@icereval
icereval / 01_complete_authentication_as_api.md
Created August 12, 2018 17:38 — forked from dgilge/01_complete_authentication_as_api.md
How to implement all needed auth endpoints including login with OAuth2 for a SPA using Django REST framework, django-rest-auth and django-allauth

Complete authentication as API including OAuth2 endpoints

I implemented an auth API for a SPA. This is rarely documented and therefore I want to share here how I did it hoping it will be a help for others.

We are still working on it and I'll update this document accordingly.

This tutorial uses following versions:

Package Version
@icereval
icereval / base.py
Last active July 7, 2018 14:37
Django Guardian Groups w/ Django ORM's Model Save Events
from django.contrib.auth.models import Group
from django.db import models
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from guardian.shortcuts import assign_perm
class EventModel(models.Model):
class Meta:
# Hack to extract module jar files into WEB-INF/classes (preferred).
Credit: https://stackoverflow.com/a/6676098
```xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
### Keybase proof
I hereby claim:
* I am icereval on github.
* I am icereval (https://keybase.io/icereval) on keybase.
* I have a public key whose fingerprint is DA20 C907 43FE AAF2 0514 D8D3 A7C4 8D92 2A02 8573
To claim this, I am signing this object:
@icereval
icereval / cleanup-daemonsetup.yml
Created January 18, 2017 23:30
Kubernetes Cleanup DaemonSet
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: cleanup
labels:
tier: system
app: cleanup
version: v3
spec:
template:
@icereval
icereval / README.md
Last active August 29, 2015 14:12 — forked from laserson/README.md

Create a FlameGraph to visualize where your code is spending its time.

Requires plop and FlameGraph.