Skip to content

Instantly share code, notes, and snippets.

View hwshim0810's full-sized avatar

Hyunwoo Shim hwshim0810

View GitHub Profile

[공통] 마크다운 markdown 작성법

1. 마크다운에 관하여

1.1. 마크다운이란?

**Markdown**은 텍스트 기반의 마크업언어로 2004년 존그루버에 의해 만들어졌으며 쉽게 쓰고 읽을 수 있으며 HTML로 변환이 가능하다. 특수기호와 문자를 이용한 매우 간단한 구조의 문법을 사용하여 웹에서도 보다 빠르게 컨텐츠를 작성하고 보다 직관적으로 인식할 수 있다. 마크다운이 최근 각광받기 시작한 이유는 깃헙(https://github.com) 덕분이다. 깃헙의 저장소Repository에 관한 정보를 기록하는 README.md는 깃헙을 사용하는 사람이라면 누구나 가장 먼저 접하게 되는 마크다운 문서였다. 마크다운을 통해서 설치방법, 소스코드 설명, 이슈 등을 간단하게 기록하고 가독성을 높일 수 있다는 강점이 부각되면서 점점 여러 곳으로 퍼져가게 된다.

1.2. 마크다운의 장-단점

1.2.1. 장점

@hwshim0810
hwshim0810 / placeholder_hide.css
Last active April 6, 2017 13:20
if focusing input tag, hide placeholder
//Placeholder 속성을 수정함
input:focus::-webkit-input-placeholder,
textarea:focus::-webkit-input-placeholder { /* WebKit browsers */
color:transparent;
}
input:focus:-ms-input-placeholder,
textarea:focus:-ms-input-placeholder { /* Internet Explorer 10+ */
color:transparent;
@hwshim0810
hwshim0810 / SqlDateToString.java
Created April 6, 2017 13:22
change sqldate format to string
SimpleDateFormat fmt=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); 
     
String sDate=fmt.format(dto.getSTIME()); 
     
String eDate=fmt.format(dto.getETIME()); 
@hwshim0810
hwshim0810 / border.css
Created April 6, 2017 13:43
jekyll markdown border css
table{
border-collapse: collapse;
border-spacing: 0;
border:2px solid;
}
th{
border:2px solid #000000;
}
@hwshim0810
hwshim0810 / admin.py
Created May 31, 2017 02:27
django admin thumnail image display
def get_thumb(self):
return format_html(
'<img src="{}" height="50" />'.format(self.inpupt_path)
)
@hwshim0810
hwshim0810 / custom_tags.py
Created June 15, 2017 06:21
템플릿 쿼리조회 옵션불가 해결
# 템플릿 쿼리조회 옵션불가 해결
@register.filter
def in_category(things, category):
return things.filter(category=category)
# 템플릿에
{% for category in categories %}
{% for thing in things|in_category:category %}
{{ thing }
@hwshim0810
hwshim0810 / functions.py
Created September 6, 2017 00:38
Django custom csv action
def export_as_csv_action(
description="CSV 파일로 출력", fields=None, exclude=None, header=True, force_fields=None):
"""
CSV 출력을 하는 Django Admin Action Function \n
:param description: Action 에 표시할 문구
:param fields: 출력 할 Model Field(Column)
:param exclude: 출력에서 제외할 Model Field
:param header: Field(Column) 이름을 첫번째 행으로 출력할지 여부
:param force_fields: Django admin 의 list_display 의 Custom field (문자열) 을 사용할 지 여부 False 인 경우 Model 에 없는 필드는 제외한다.
"""
@hwshim0810
hwshim0810 / box.css
Created October 4, 2017 13:18
Css change box postion
#blockContainer {
display: -webkit-box;
display: -moz-box;
display: box;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
box-orient: vertical;
}
#blockA {
-webkit-box-ordinal-group: 2;
@hwshim0810
hwshim0810 / dynamic_favicon.js
Created November 6, 2017 06:57
Dynamic favicon using javascript
(function() {
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href = 'http://www.stackoverflow.com/favicon.ico';
document.getElementsByTagName('head')[0].appendChild(link);
})();
@hwshim0810
hwshim0810 / getkeyhash.java
Created December 14, 2017 02:45
Use for SDK : KeyHash
try {
PackageInfo info = getPackageManager().getPackageInfo("myandroid.package.name", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
DebugLogger.d("==============================");
DebugLogger.d("KeyHash:" + Base64.encodeToString(md.digest(), Base64.DEFAULT));
DebugLogger.d("==============================");
}
} catch (PackageManager.NameNotFoundException e) {