Skip to content

Instantly share code, notes, and snippets.

@tombohub
tombohub / es6-import-cheat-sheet.md
Created Oct 15, 2020 — forked from samueljseay/es6-import-cheat-sheet.md
ES6 exports / imports cheat sheet
View es6-import-cheat-sheet.md
// default exports
export default 42;
export default {};
export default [];
export default (1 + 2);
export default foo;
export default function () {}
export default class {}
export default function foo () {}
@tombohub
tombohub / imagewiththumbnails_updateable.py
Created Aug 7, 2020 — forked from valberg/imagewiththumbnails_updateable.py
Django create thumbnail form ImageField and save in a different ImageField - now with updating!
View imagewiththumbnails_updateable.py
# Extension of http://www.yilmazhuseyin.com/blog/dev/create-thumbnails-imagefield-django/
# Note: image_folder and thumbnail_folder are both a callable (ie. a lambda that does a '/'.join())
class Image(Media):
image = models.ImageField(
upload_to=image_folder
)
thumbnail = models.ImageField(