Skip to content

Instantly share code, notes, and snippets.

View uptown's full-sized avatar
🦖
T-rex

Mark Juyoung Lee uptown

🦖
T-rex
View GitHub Profile
@uptown
uptown / clean_code.md
Last active August 10, 2022 08:59 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

클린코드란?

  • 팀의 모든 사람에게 쉽게 이해되는 코드가 있다면, 그거시 바로 클린코드 입니다.

클린코드의 아름다운 모습

  • 클린 코드는 Author 외에도 읽고 개선할 수 있어야합니다. 그것을 바탕으로 모든게 쉬워집니다.
    • 읽기 쉽고
    • 수정하기 쉽고
    • 확장도 쉽고
    • 유지보수도 쉽고
# generate random integer values
from random import randint
def swap(arr, x, y):
temp = arr[x]
arr[x] = arr[y]
arr[y] = temp
package co.halfz.commons.http;
import org.apache.http.HttpHost;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.nio.protocol.HttpAsyncRequestProducer;
import org.apache.http.nio.protocol.HttpAsyncResponseConsumer;
import org.apache.http.protocol.HttpContext;
import React, {useState} from 'react'
const HoverAnimation = () => {
const [triggered, setTriggered] = useState(false);
return <div onMouseEnter={() => setTriggered(true)} class={triggered? 'animation-class': 'default-class'} />;
}
@uptown
uptown / NSObject+UTFrameworkProtected.h
Last active August 29, 2015 14:25
iOS Auto-adjusting autolayout snippet with some tricks
//
// NSObject+UTFrameworkProtected.h
// UTFramework
//
// Created by Juyoung Lee on 2014. 1. 2..
// Copyright (c) 2014년 Juyoung.me. All rights reserved.
//
#import <Foundation/Foundation.h>
// NSObject내에 저장된 callback을 실행시키는 핼퍼
//
// NSAttributedString+format.m
// Chatterbox
//
// Created by Brent Royal-Gordon on 2/7/14.
// Copyright (c) 2014 Architechies. All rights reserved.
//
#import "NSAttributedString+format.h"
import sleekxmpp
import logging
logging.basicConfig(level=logging.DEBUG)
class SendMsgBot(sleekxmpp.ClientXMPP):
"""
A basic SleekXMPP bot that will log in, send a message,
and then log out.
"""
import os
import datetime
from mongoengine.base import BaseField
from mongoengine.python_support import str_types
from django.core.files.storage import default_storage
from django.utils.encoding import force_str, force_text
class DjangoStorageFileWrapper(object):
class A(object):
def method1(self):
print "method1"
def __method1(self):
print "__method1"
class B(A):