Skip to content

Instantly share code, notes, and snippets.

View landzz's full-sized avatar

landzz landzz

  • seoul south korea
View GitHub Profile
@landzz
landzz / database_dump_for_mysql.php
Last active February 16, 2023 09:04
php database dump tool for mysql
<?php
/**
* php database dump tool for mysql
* @author https://github.com/landzz
* @version 0.1
*/
error_reporting(E_ALL ^ E_NOTICE);
@set_time_limit(0);
@xnuk
xnuk / hyeong.md
Last active November 3, 2025 10:50
난해한 혀엉.... 언어

난해한 혀엉... 언어 v0.4.5

  • (U+2026), (U+22EF), (U+22EE)는 모두 .(U+002E)가 3번 연속으로 나열된 것과 같은 것으로 봅니다.
  • "한글 음절 문자"는 가(U+AC00) 이상 힣(U+D7A3) 이하의 유니코드 문자들을 의미합니다.

스택

  • 스택의 모든 원소는 유리수 또는 NaN으로 이루어져 있습니다. 분모가 1인 유리수를 편의상 정수라고 칭합니다.
  • NaN은 특수한 숫자처럼 취급됩니다. 어떠한 연산을 하더라도 그 연산에 NaN이 있을 경우 그 연산의 값은 NaN이 됩니다.
@landzz
landzz / DirLib.php
Last active February 16, 2023 06:45
php directory explorer
<?php
/**
* php directory explorer
*
* @author https://github.com/landzz
* @version 1.1
* @link https://gist.github.com/landzz/db4037aadd44f89a0cef
* HTTP Digest authentication is added
*/
@bbirec
bbirec / util.sql
Last active May 22, 2024 03:29
Postgres 유용한 query모음.
-- auto vaccum이 되었던 시간과 개수
select relname, autovacuum_count, last_autovacuum::timestamp with time zone at time zone 'Asia/Seoul' from pg_stat_all_tables where last_autovacuum is not null order by last_autovacuum desc limit 20;
-- 현재 실행중인 query
SELECT pid,query,now()-query_start as diff,query_start,state_change FROM pg_stat_activity where state='active' order by query_start desc;
-- 실행중인 pid kill
SELECT pg_terminate_backend(
--pid
@camille-hdl
camille-hdl / js.stx
Last active October 20, 2022 09:22
ES6-friendly EditPlus syntax file
#TITLE=JavaScript
; JavaScript syntax file written by ES-Computing, edited by https://github.com/Eartz/ based on ECMA-262 6th Edition / Draft April 3, 2015.
; This file is required for EditPlus to run correctly.
#DELIMITER=,(){}[]-+*%/="'`~!&|<>?:;.
#QUOTATION1='
#QUOTATION2="
#QUOTATION3=`
#LINECOMMENT=//
#LINECOMMENT2=
@kijin
kijin / attachment.php
Last active August 24, 2020 02:58
UTF-8 파일 다운로드 함수
<?php
/**
* PHP 파일 다운로드 함수.
* Version 1.3
*
* Copyright (c) 2014 성기진 Kijin Sung
*
* License: MIT License (a.k.a. X11 License)
* http://www.olis.or.kr/ossw/license/license/detail.do?lid=1006
@kijin
kijin / aes_encrypt.php
Last active September 18, 2019 14:44
PHP에서 AES-256과 HMAC을 사용하여 문자열을 암호화하고 위변조를 방지하는 법
<?php
// AES-256과 HMAC을 사용하여 문자열을 암호화하고 위변조를 방지하는 법.
// 비밀번호는 서버만 알고 있어야 한다. 절대 클라이언트에게 전송해서는 안된다.
// PHP 5.2 이상, mcrypt 모듈이 필요하다.
// 문자열을 암호화한다.
function aes_encrypt($plaintext, $password)
{
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active October 22, 2025 20:58
Backend Architectures Keywords and References
@kijin
kijin / gist:5829736
Last active February 10, 2022 14:44
HTML Purifier 사용예제
// 웹사이트에서 다운받아 적당한 곳에 압축 푸세요.
require_once('/경로/htmlpurifier/library/HTMLPurifier.auto.php');
// 기본 설정을 불러온 후 적당히 커스터마이징을 해줍니다.
$config = HTMLPurifier_Config::createDefault();
$config->set('Attr.EnableID', false);
$config->set('Attr.DefaultImageAlt', '');
// 인터넷 주소를 자동으로 링크로 바꿔주는 기능
$config->set('AutoFormat.Linkify', true);
@resting
resting / gist:3421760
Created August 22, 2012 02:41 — forked from RiANOl/gist:1077723
AES128 encrypt/decrypt in PHP with base64
<?
function aes128Encrypt($key, $data) {
if(16 !== strlen($key)) $key = hash('MD5', $key, true);
$padding = 16 - (strlen($data) % 16);
$data .= str_repeat(chr($padding), $padding);
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $data, MCRYPT_MODE_CBC, str_repeat("\0", 16)));
}
function aes128Decrypt($key, $data) {