This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import configparser | |
from io import StringIO | |
class OpenSSLCnf: | |
def __init__(self, cn): | |
# todo database load cn | |
self.cnf = configparser.ConfigParser(allow_no_value=True) | |
self.cnf.optionxform = str | |
self.default_ca_name = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// we will do our own error handling | |
error_reporting(0); | |
// user defined error handling function | |
function userErrorHandler($errno, $errmsg, $filename, $linenum, $vars) { | |
// timestamp for the error entry | |
$dt = date("Y-m-d H:i:s (T)"); | |
// define an assoc array of error string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once "$_SERVER[DOCUMENT_ROOT]/vendor/autoload.php"; | |
use \Monolog\Logger as Logger; | |
use Monolog\Handler\SlackWebhookHandler; | |
// 로거 채널 생성 | |
$log = new Logger('logger name'); | |
// log/your.log 파일에 로그 생성. 로그 레벨은 Info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def my_except_hook(exctype, value, traceback): | |
if exctype == KeyboardInterrupt: | |
print("Handler code goes here") | |
else: | |
print('Error Send...') | |
sys.__excepthook__(exctype, value, traceback) | |
sys.excepthook = my_except_hook |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
class DisplayablePath(object): | |
display_filename_prefix_middle = '├──' | |
display_filename_prefix_last = '└──' | |
display_parent_prefix_middle = ' ' | |
display_parent_prefix_last = '│ ' | |
def __init__(self, path, parent_path, is_last): | |
self.path = Path(str(path)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.17) | |
project(wxTest) | |
set(CMAKE_CXX_STANDARD 14) | |
set(MSYS TRUE) | |
set(wxWidgets_USE_UNICODE TRUE) | |
add_executable(wxTest main.cpp) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################ | |
# XPayClient.py | |
# | |
# 이 라이브러리를 사용해서 발생하는 책임은 지지 않습니다. | |
# 이 라이브러리는 LG U+ 전자결제 시스템의 PHP 버전을 파이썬 3.7 기반으로 고친 것입니다. | |
# 이 라이브러리의 원작(PHP 버전) 저작권은 LG U+에 있으며 이 라이브러리의 저작권은 Apache License 입니다. | |
# 이 라이브러리 사용 후 발생되는 모든 책임은 저와 LG U+에 없으므로 유의하시기 바랍니다. | |
# | |
# 변환자: 이지호([email protected]) | |
# Translate Date: 2020.07.22 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import click | |
import csv | |
@click.group() | |
def cli(): | |
pass | |
@cli.command() | |
def duplicate(): | |
'''중복 걸러내기''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from html.entities import entitydefs | |
from functools import partial | |
def html5char(value): | |
def key_find(find_value, key): | |
return entitydefs[key] == find_value | |
f = filter(partial(key_find, value), entitydefs) | |
return "&{0};".format(tuple(f)[0]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding: utf-8 -*- | |
from __future__ import print_function | |
from __future__ import unicode_literals | |
from functools import partial | |
import codecs | |
import click | |
from xml.dom.minidom import parse | |
@click.command() | |
@click.argument('core') |