Skip to content

Instantly share code, notes, and snippets.

View yoojinyoung's full-sized avatar
:octocat:
Working in Seoul

Yoo Jin Young yoojinyoung

:octocat:
Working in Seoul
View GitHub Profile
@yoojinyoung
yoojinyoung / readFileAsync.js
Created February 12, 2020 06:13
Using the FileReader API in async functions
// https://simon-schraeder.de/posts/filereader-async/
function readFileAsync(file) {
return new Promise((resolve, reject) => {
let reader = new FileReader();
reader.onload = () => {
resolve(reader.result);
};
@yoojinyoung
yoojinyoung / pdf_to_image.py
Last active December 4, 2019 05:26
How to make pdf to image and and save that with instance when using django.
# https://github.com/Belval/pdf2image
# https://www.revsys.com/tidbits/loading-django-files-from-code/
import os
import tempfile
from django.core.files import File
from pdf2image import convert_from_path
from .models import CustomModel
[
"하늘을 우러러 한 점 부끄럼이 없기를",
"흙에서 자란 내마음 파란 하늘빛",
"넓은벌 동쪽끝으로 옛이야기",
"붉은 파밭의 푸른 새싹을 보아라",
"손금에는 맑은 강물이 흐르고",
"햇빛도 그늘이 있어야 맑고 눈이 부시다",
"엷은 졸음에 겨운 늙으신 아버지가",
"격의 없이 터놓은 관계라도 기본 예는 갖춤이 옳거니",
"이 많은 별빛이 내린 언덕 위에",
@yoojinyoung
yoojinyoung / settings.py
Last active January 6, 2019 03:55
django settings.py code for deloyment
import os
import json
from django.core.exceptions import ImproperlyConfigured
# Set ENV with system variable 'DJANGO_ENV'. If 'DJANGO_ENV' is not present, then use 'development' as ENV.
# In production server, set 'DJANGO_ENV' as 'production'
ENV = os.getenv('DJANGO_ENV', 'development')