Skip to content

Instantly share code, notes, and snippets.

View ugaemi's full-sized avatar
🐜
Working

YugyeongKim ugaemi

🐜
Working
View GitHub Profile
@ugaemi
ugaemi / postfix.py
Last active October 31, 2018 13:26
불꽃코딩 스터디 1935. 후위표기식2
import sys
import string
OP = ['+', '-', '*', '/']
operand_num = int(input())
if not 1 <= operand_num <= 26:
sys.exit(1)
math_ex = list(input())
@ugaemi
ugaemi / hideObj.js
Last active June 5, 2020 09:30
Hide object when click other area
$('html, body').on('click', function (e) {
var tgPoint = $(e.target);
var obj = tgPoint.hasClass($('selector'));
if (!obj) {
$(obj).hide();
}
});
@ugaemi
ugaemi / changeBgColor.css
Created June 5, 2020 09:29
Focusing use background-color
@keyframes changeBgColor {
0% {
background-color: #ffffff;
}
50% {
background-color: aliceblue;
}
100% {
background-color: #ffffff;
}
@ugaemi
ugaemi / Dockerfile
Last active June 23, 2020 08:46
Django Dockerfile
FROM python:3.7
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
RUN mkdir /code/staticfiles
WORKDIR /code
RUN apt-get update
RUN apt-get upgrade -y
@ugaemi
ugaemi / center_crop.py
Created June 17, 2020 10:52
Center Crop Image
def crop(original_file, width, height):
original_image = Image.open(original_file)
original_width, original_height = original_image.size
if original_width < original_height:
original_height = int(original_height * (width / original_width))
original_image = original_image.resize((width, original_height))
crop_img = original_image.crop((0, abs(original_height - height)/2, width, (original_height + height)/2))
else:
original_width = int(original_width * (height / original_height))
@ugaemi
ugaemi / setting.py
Created June 23, 2020 08:44
StrictManifestStaticFilesStorage
STATICFILES_STORAGE = 'core.storage.StrictManifestStaticFilesStorage'
@ugaemi
ugaemi / storage.py
Created June 29, 2020 04:40
Save original filename to s3
class MediaStorage(S3Boto3Storage):
location = settings.AWS_MEDIA_LOCATION
file_overwrite = False
def _save(self, name, content):
self.object_parameters.update({
'ContentDisposition': f'attachments; filename="{content._name}"'})
return super()._save(name, content)
import os
import subprocess
import shutil
POSITIONS = ['Backend', 'Frontend']
ASSIGNMENT_TYPE = {
"Backend-Assignment": ["A", "B"],
"Frontend-Assignment": None,
}