Skip to content

Instantly share code, notes, and snippets.

View an-dev's full-sized avatar

Andy an-dev

View GitHub Profile
{"name":"andy","settings":"{\"settings\":\"{\\n \\\"files.exclude\\\": {\\n \\\"**/*.pyc\\\": true,\\n \\\"**/*.min.js\\\": true,\\n \\\"**/*.js.map\\\": true,\\n \\\"/static/\\\": true,\\n \\\"node_modules\\\": true,\\n \\\"build\\\": true,\\n \\\"*.log\\\": true,\\n \\\"*.egg-info\\\": true\\n },\\n \\\"editor.formatOnSave\\\": true,\\n \\\"search.followSymlinks\\\": false,\\n \\\"files.trimTrailingWhitespace\\\": true,\\n \\\"files.trimFinalNewlines\\\": true,\\n \\\"files.insertFinalNewline\\\": true,\\n \\\"[typescriptreact]\\\": {\\n \\\"editor.codeActionsOnSave\\\": {\\n \\\"source.fixAll.eslint\\\": true\\n }\\n },\\n \\\"[typescript]\\\": {\\n \\\"editor.codeActionsOnSave\\\": {\\n \\\"source.fixAll.eslint\\\": true\\n }\\n },\\n \\\"[javascript]\\\": {\\n \\\"editor.codeActionsOnSave\\\": {\\n \\\"source.fixAll.eslint\\\": true\\n }\\n },\\n \\\"[javascriptreact]\\\": {\\n \\\"editor.codeActionsOnSave\\\": {\\n \\\"source
@an-dev
an-dev / MultiPartSerializerForRestlessTornado.py
Created August 6, 2019 15:43
Multipart file upload aware custom JSON serializer for Restless using Tornado utils
#!/usr/bin/env python
# coding:utf-8
import StringIO
import os
import uuid
import restless.exceptions
import restless.serializers
import restless.tnd
import tornado.httputil
@an-dev
an-dev / validators.py
Created April 7, 2019 21:52 — forked from mobula/validators.py
Performs file upload and image upload validation for django.
# -*- coding: utf-8 -*-
# https://gist.github.com/mobula/da99e4db843b9ceb3a3f
# @brief
# Performs file upload validation for django.
# with Django 1.7 migrations support (deconstructible)
# Provides:
# - FileValidator
# - ImageValidator (adds Image specific validation using PIL)