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 February 11, 2024 15:10
난해한 혀엉.... 언어

이 문서가 여기저기 알려짐에 따라, 이곳에 여러가지 댓글이 달리고 있습니다. 개인적으로는 댓글창을 없애버리고 싶지만 그럴 수 없는 터라, 댓글을 달기 전에 한번씩만 더 생각해주셨으면 합니다.

  • 개인적인 감상은 이곳이 아닌 다른 곳에 적어주세요.
  • 동성애 혐오적인 댓글을 달지 마세요.
  • 기타 "난해한 혀엉... 언어"와 관련없는 댓글을 달지 말아주세요.

위 사항들을 포함해 제 마음에 안 드는 댓글들은 임의로 삭제하고 있습니다. 양해 부탁드립니다.


@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 April 11, 2018 02:11
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 April 17, 2024 10:51
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) {