Skip to content

Instantly share code, notes, and snippets.

View search5's full-sized avatar

Jiho Persy Lee search5

View GitHub Profile
@search5
search5 / permisson.py
Last active October 10, 2018 19:28
Python zipfile의 ZipInfo 인스턴스에 있는 external_attr을 받아서 파일 퍼미션을 구하는 함수
def permission(external_attr):
stat_ix = (4, 2, 1)
user_perm = 0
for mode_num, mode in zip(stat_ix, (stat.S_IRUSR, stat.S_IWUSR, stat.S_IXUSR)):
if (external_attr & mode) > 0:
user_perm += mode_num
grp_perm = 0
for mode_num, mode in zip(stat_ix, (stat.S_IRGRP, stat.S_IWGRP, stat.S_IXGRP)):
@search5
search5 / font-install.sh
Created August 23, 2018 10:39
Confluence 한글 폰트 설치 스크립트(남이 만든거 약간 더 개선했습니다)
#!/bin/sh
if [ "$#" -lt 1 ]; then
echo -e "$# is Illegal number of parameters.\n"
echo -e "Usage: $0 confluence-installed-dir\n"
echo "Example: $0 /opt/atlassian/confluence"
exit 1
fi
CONF_DIR=$1
@search5
search5 / pdf_mc_table.py
Created August 8, 2017 19:03
PyFPDF에서 테이블을 구현하기 위해서 포팅한 라이브러리
#-*- coding: utf-8 -*-
# original URL: http://fpdf.de/downloads/addons/3/
__author__ = 'jiho'
from fpdf import FPDF
class PDF_MC_Table(FPDF):
def SetWidths(self, w):
# Set the array of column widths
self.widths = w
def SetAligns(self, a):
# Set the array of column alignments
<button id="duplicateBtn">중복 로딩 테스트</button>
<script>
var button = document.querySelector("#duplicateBtn");
button.addEventListener("click", function(e) {
//alert("버튼이 눌렸어요.");
//console.log(e);
// document level에 커스텀 이벤트 호출하기
var ev = new CustomEvent("btnClick", {
detail: {