Skip to content

Instantly share code, notes, and snippets.

@tombohub
tombohub / es6-import-cheat-sheet.md
Created October 15, 2020 20:21 — forked from samueljseay/es6-import-cheat-sheet.md
ES6 exports / imports cheat sheet
// 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 August 7, 2020 04:47 — forked from valberg/imagewiththumbnails_updateable.py
Django create thumbnail form ImageField and save in a different ImageField - now with updating!
# 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(