Skip to content

Instantly share code, notes, and snippets.

View junejie's full-sized avatar

junejie

  • Manila, PH
View GitHub Profile
#!/usr/bin/env bash
docker volume rm $(docker volume ls -qf dangling=true)
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
docker rmi $(docker images | grep "none" | awk '/ / { print $3 }')
docker rm $(docker ps -qa --no-trunc --filter "status=exited")
@junejie
junejie / views.py
Created March 16, 2018 03:17
Django rest framework model-less
from rest_framework import viewsets
from rest_framework.response import Response
from rest_framework import serializers
from rest_framework.authentication import SessionAuthentication, BasicAuthentication
from rest_framework.permissions import IsAuthenticated
class Cart(object):
def __init__(self, **kwargs):
fields = ('id', 'price', 'quantity', 'total')
for field in fields: