Skip to content

Instantly share code, notes, and snippets.

View hashlash's full-sized avatar

hashlash

View GitHub Profile
$ ./manage.py makemigrations
No changes detected
$ ./manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, contenttypes, my_app, sessions
Running migrations:
No migrations to apply.
$ ./manage.py migrate --fake my_app zero
Operations to perform:
Unapply all migrations: my_app
@hashlash
hashlash / README.md
Last active October 17, 2021 15:21
Setup Kubernetes Using Kubeadm Cheatsheet (It Just Work!)
@hashlash
hashlash / graphql.py
Last active March 20, 2021 06:57
pkg.go.dev repo imported by sorted by stats
import json
import re
import requests
import uuid
# No OAuth scope required
# Just create a personal access token on https://github.com/settings/tokens/new
API_KEY = 'api key example'
QUERY_FORMAT = '''
@hashlash
hashlash / docker-management.md
Created November 2, 2020 06:44
Docker Management

Volume

  • Get all volumes directory and its size
docker volume ls --format {{.Name}} | xargs docker inspect --format {{.Mountpoint}} | sudo xargs du -sh
@hashlash
hashlash / Caddyfile
Last active June 15, 2021 03:11 — forked from ryanburnette/Caddyfile
Caddy v2.1 CORS whitelist
(cors) {
@origin{args.0} header Origin {args.0}
header @origin{args.0} Access-Control-Allow-Origin "{args.0}"
}
(cors_regexp) {
@origin_regexp{args.0} header_regexp Origin {args.0}
header @origin_regexp{args.0} Access-Control-Allow-Origin "{header.Origin}"
}
@hashlash
hashlash / schema.yaml
Created March 11, 2022 03:33
DRF bug SafeString help_text
openapi: 3.0.2
info:
title: Your Project
version: 1.0.0
description: "API for all things \u2026"
paths:
/example-model/:
get:
operationId: listExampleModels
description: Concrete view for listing a queryset or creating a model instance.