Skip to content

Instantly share code, notes, and snippets.

View srcmaker's full-sized avatar

Manny Lee srcmaker

  • Seoul, South Korea
View GitHub Profile
@srcmaker
srcmaker / get_linkable_url.php
Last active December 9, 2020 00:52
get ascii-based url from a url which contains unicode
<?php
/**
* @param $url
* @param bool $validate
* @return string
*/
function get_linkable_url($url, $validate = true)
{
<?php
/**
* @param $string
* @return bool
*
* 대한민국 이름인지 체크
* 대법원 가족관계등록예규 제109호에 의하면 이름 글자수는 성을 제외하고 5자를 넘을 수 없다.
*
*/
@srcmaker
srcmaker / gist:34d00c5a767bf4d0c73a47bd72f33196
Last active April 23, 2021 04:24
Python 으로 대형 솔루션을 만들 때 점검사항
https://engineering.soroco.com/building-large-scale-systems-and-products-with-python/
아래 내용은 위 URL 에 나온 Soroco 라는 페이지의 회사의 경험을 참고하여 요약한 것임
1. Dynamic Type 언어의 취약점 벗어나기
PEP484 (Type Hint) 의 룰을 따라 코딩한다.
mypy 를 이용하여 PEP484 룰을 강제한다
@srcmaker
srcmaker / strip_for_json.py
Last active November 4, 2021 01:37
strip any unnecessary characters from string to make it a json string
def strip_for_json(jstr):
"""
strip any unnecessary characters from string
to make it a json string.
does not garantee the returened string is a real json string.
just for next process.
"""
occupied = [('[',']'),('{','}')]
@srcmaker
srcmaker / Sqliter.php
Last active December 12, 2023 09:14
php class to get singlton sqlite connection
namespace Manny;
/**
* SQLite Connection Manager
*
*/
class Sqliter
{
protected $sqlite = null;