Skip to content

Instantly share code, notes, and snippets.

using System.Collections;
using UnityEngine;
public class DNode<T>
{
public DNode<T> Next;
public DNode<T> Prev;
public T Data { get; private set; }
public DNode(T data)
@jrog612
jrog612 / index.css
Last active March 27, 2024 09:06
elice board
.post-item {
padding: 16px;
border-bottom: 1px solid #efefef;
}
.post-title {
font-size: 22px;
font-weight: bold;
margin-bottom: 10px;
}
import datetime
import pend
from django.core import exceptions
from django.db import models
from pendulum.parsing import ParserError
class DateTimeField(models.DateTimeField):
def from_db_value(self, value, *args, **kwargs):
@jrog612
jrog612 / image_field.py
Created December 5, 2020 06:19
Django Image model and ImageField
from django.db import models
from django.db.models.fields.related_descriptors import ForwardManyToOneDescriptor
from jackal.shortcuts import get_model
from jackal.shortcuts import get_object_or_None
class ImageDescriptor(ForwardManyToOneDescriptor):
def __set__(self, instance, value):
"""
:param instance: ImageField 를 정의한 모델 인스턴스
"""
required pendulum
"""
import pendulum as pd
settings = {
"compare": [
"UTC",
"Europe/Paris",
@jrog612
jrog612 / pycharm-inspections.txt
Last active October 31, 2018 01:40 — forked from pylover/inspections.txt
PyCharm inspections
# Extracted using: $ unzip -p lib/pycharm.jar com/jetbrains/python/PyBundle.properties | grep -B1 INSP.NAME | grep '^#' | sed 's|Inspection||g' | sed -e 's|#\s\{,1\}|# noinspection |'
# noinspection PyPep8
# noinspection PyPep8Naming
# noinspection PyTypeChecker
# noinspection PyAbstractClass
# noinspection PyArgumentEqualDefault
# noinspection PyArgumentList
# noinspection PyAssignmentToLoopOrWithParameter
# noinspection PyAttributeOutsideInit
@jrog612
jrog612 / social_login_helpers.py
Created July 12, 2018 06:43
Social Login Helper class
class FacebookAuthHelper:
url_debug_token = "https://graph.facebook.com/debug_token"
url_user_info = "https://graph.facebook.com/v3.0/{}"
@staticmethod
def get_secret_code():
return APP_SECRET
@staticmethod
def get_app_id():
@jrog612
jrog612 / nginx-app.conf
Created June 14, 2018 02:00
Django uWsgi https
server {
listen 80 default_server;
server_name ~^.*$;
charset utf-8;
client_max_body_size 128M;
location / {
uwsgi_pass unix:///tmp/app.sock;
include uwsgi_params;
}
@jrog612
jrog612 / .vimrc
Last active May 14, 2018 06:59
ubuntu 서버 설정
syntax on
set nu
set tabstop=4
set autoindent
set ruler
set showcmd
set title
set wmnu
set showmatch
import re
from django.utils import timezone
def get_datetime_filename(filename):
pattern = re.compile(r'\.[a-z0-9]+$')
extension = re.search(pattern, filename).group()
dt = timezone.now().strftime('%Y_%m_%d_%H%M%S%f')
return dt + extension