Skip to content

Instantly share code, notes, and snippets.

View potados99's full-sized avatar
😵‍💫
악!

Potados potados99

😵‍💫
악!
View GitHub Profile
@potados99
potados99 / pre-commit.sh
Created August 18, 2024 03:33
Pre commit hook
#!/bin/bash
[ "$(git symbolic-ref --short HEAD)" = "main" ] && echo "Pushing to main is not allowed." && exit 1
@potados99
potados99 / Scratch.java
Last active January 15, 2024 06:57
붕어빵틀
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Comparator;
import java.util.stream.Stream;
class XorPerformer {
@potados99
potados99 / Scratch.java
Last active January 1, 2024 13:27
표준ㅋ암호화ㅋㅋㅎ
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Base64;
class Scratch {
public static void main(String[] args) throws IOException {
String pathPrefix = "C:\\Users\\Administrator\\AppData\\Roaming\\Google\\AndroidStudio2023.1\\scratches";
String filename = "20240101-123사4567-X-10-1234678.TXT";
@potados99
potados99 / main.cpp
Created December 14, 2023 09:49
Self registering factory pattern, modified
/*
Original source code from: https://www.nirfriedman.com/2018/04/29/unforgettable-factory/
*/
#include <iostream>
#include <string>
#include <vector>
template<class Base>
class Factory {
@potados99
potados99 / memberSeq.sh
Last active February 12, 2023 00:36
공군 기본군사훈련단 인터넷 편지 memberSeq 구해오는 스크립트
curl 'http://airforce.mil.kr:8081/user/emailPicViewSameMembers.action?siteId=last2&searchName=송병준&searchBirth=19990211' -L -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36' | grep "선택하기" | sed -e 's/.*[^0-9]\([0-9]\+\)[^0-9]*$/\1/'
@potados99
potados99 / public_api.sql
Created December 27, 2022 05:51
Public API 템플릿
/**
POP 클라이언트가 직접 호출하는 public 프로시저 템플릿입니다.
모든 예외가 여기서 잡히며, 트랜잭션을 관리합니다.
프로시저 이름, 아래 주석과 v_tag, v_summary, v_detail을 수정한 후 사용하여 주세요.
*/
create
definer = MES_DHSol@`%` procedure sp_POP_GJ_BLAH_BLAH(
in $EQP_MASTER_CD varchar(32),
in $PRD_WO_CD varchar(32),
in $EMP_CD varchar(32)
@potados99
potados99 / package_module_method.sql
Created December 27, 2022 05:50
패키지 모듈 메소드 템플릿
/**
내부에서 사용되는 패키지 모듈용 메소드 프로시저 템플릿입니다.
트랜잭션과 예외 처리기가 없습니다.
프로시저 이름, 아래 주석과 v_tag, v_summary, v_detail을 수정한 후 사용하여 주세요.
*/
create
definer = MES_DHSol@`%` procedure Package_Module_Method(
)
comment '~하는 프로시저'
begin
@potados99
potados99 / package_module_function.sql
Created December 27, 2022 05:50
패키지 모듈 함수 템플릿
/**
내부에서 사용되는 패키지 모듈용 메소드 함수 템플릿입니다.
트랜잭션과 예외 처리기가 없습니다.
함수 이름, 아래 주석과 v_tag, v_summary, v_detail을 수정한 후 사용하여 주세요.
*/
create
definer = MES_DHSol@`%` function Package_Module_Method(
) returns varchar(32)
comment '~하는 함수'
begin
@potados99
potados99 / index.js
Last active July 29, 2023 14:37
임시 데이터 수집기(collect.potados.com) AWS Lambda 구현
const fs = require('fs').promises;
const path = require('path');
const { randomUUID } = require('crypto');
async function getDataSource(channelName) {
const channelNameSanitized = channelName.replace(/\//g, '').replace(/\./g, '').trim();
if (!channelNameSanitized) {
throw new Error(`Invalid channel name: [${channelName}]`);
}
@potados99
potados99 / cloud-config.txt
Last active October 30, 2022 14:46
RMS Cloud Config
Zv65DvZ4uip59etBkYX2eVt5gDWosL2+U7Ll0BdQ41tZv2MrD6pQQ3VzomCiQkJgruU/wAZnG3NY0HJRevAVGttC3dU5+s3km2r6Cf2k4UaN37wKMz7JZIu6wMJ4kqFDW73hIeieTEZW8DZki66cvO++W+fuz9Kajio2k/ZslbSSZ3BkzNp3E12Gb99m9v18rZpROWQ5xMPbnZkLMNW68yMHeNGcWMJuiN++FyRDCSRu3PwTmVZBkWC9pi+n1BYqTacnd3cbboYrWG6M4uFn1p7X28X5seDVKlx3S+t4xbwJJAOIWDG3BNyAuWmTM9tXNShnWhjs/nLgAtHmuEo4Q5FQwMtYVrcNlAd92G9FC605vkZazXvG1q31PmpHKRUOOi25w7jKrl3NzbJsiHyf7Es/VGtKse/26SE/oVOZeI10jL9BAfGzLdFtpwYaVZqT58vo8Ld0YCEaIzZ7dVDQQbg5AAso5U29QE+AxAHZQxYzBn6BBKlde0e0E32uIwBocWZNMtY6y5dHuDLpaZ/gXvYA/23l92mwKcC8rhVfUXVrIIHsA2I5fAhdUKp3atNgdugu+M9o5N1laB8fT1KqwFulbsCrG2v5AuUiuza1XYrQFb2k6JPOgLYOT3nftQqEPyiD4rViXlzbCZ/BzZ/vKUw1EEOFq1WXAo+X6o1EZ8lJwRVCdtZJbVaEdv8iSLTs9qaFPxu/Jkw+vcevINoCFr+R8vGn0OKVM+EjEJpospH7TDHVe7rVeinLbjbmSZQd3QBdqYo8U8K8QQEpqqXUgA/qxGdG11qOGP7lBtX5719QOGJCRIkJpLBaEaWYdW8mkm+ediAI9GhvedTK8TUsqr1FbVkvgpS5W/3K8wYTpfR41xKWbQi0qiH5E3wlI90TDCNM9HMS7Xo1WONJyaAeVQ==