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
class A(object):
def method1(self):
print "method1"
def __method1(self):
print "__method1"
class B(A):
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):
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.
"""
//
// NSAttributedString+format.m
// Chatterbox
//
// Created by Brent Royal-Gordon on 2/7/14.
// Copyright (c) 2014 Architechies. All rights reserved.
//
#import "NSAttributedString+format.h"
@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์„ ์‹คํ–‰์‹œํ‚ค๋Š” ํ•ผํผ
import React, {useState} from 'react'
const HoverAnimation = () => {
const [triggered, setTriggered] = useState(false);
return <div onMouseEnter={() => setTriggered(true)} class={triggered? 'animation-class': 'default-class'} />;
}
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;
# generate random integer values
from random import randint
def swap(arr, x, y):
temp = arr[x]
arr[x] = arr[y]
arr[y] = temp
@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 ์™ธ์—๋„ ์ฝ๊ณ  ๊ฐœ์„ ํ•  ์ˆ˜ ์žˆ์–ด์•ผํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๊ฒƒ์„ ๋ฐ”ํƒ•์œผ๋กœ ๋ชจ๋“ ๊ฒŒ ์‰ฌ์›Œ์ง‘๋‹ˆ๋‹ค.
    • ์ฝ๊ธฐ ์‰ฝ๊ณ 
    • ์ˆ˜์ •ํ•˜๊ธฐ ์‰ฝ๊ณ 
    • ํ™•์žฅ๋„ ์‰ฝ๊ณ 
    • ์œ ์ง€๋ณด์ˆ˜๋„ ์‰ฝ๊ณ