Skip to content

Instantly share code, notes, and snippets.

View dbwodlf3's full-sized avatar
๐Ÿข
I may be slow to respond.

Cogi dbwodlf3

๐Ÿข
I may be slow to respond.
  • SWLAB
  • Republic of Korea
View GitHub Profile
@dbwodlf3
dbwodlf3 / parse.js
Last active September 22, 2022 07:25
parse opengraph
/** Parsing only meta in headtag. */
export function parse_opengraph(inputHTML) {
const filter_head = /<head>[^]*<\/head>/i;
let filter_meta_og = /<meta[^>]*property[^>]*=[^>]*(og:)[^>]*>/ig;
let head = inputHTML.match(filter_head)[0];
const metas = head.match(filter_meta_og);
if(!metas) return;
const opengraph = {}
@dbwodlf3
dbwodlf3 / readme.md
Last active August 11, 2022 09:06
FMQ Basic Concept

Baisic CSV Task์— ๋Œ€ํ•œ Message Queue

  1. Define a primitive task unit. - ๊ฐ€์žฅ ์ž‘์€ ์ž‘์—…๋‹จ์œ„์— ๋Œ€ํ•ด์„œ ์ •์˜

  2. ์ž‘์—… ํŒŒ์ผ์„ primitive task unit ํŒŒ์ผ๋กœ ๋ถ„ํ• . () ==> Core. ์–ด๋–ป๊ฒŒ ๊ฐ€์žฅ ์ž‘์€ Task Unit์œผ๋กœ ํšจ์œจ์ ์œผ๋กœ ์ž˜๋ผ๋‚ผ ์ˆ˜ ์žˆ๋Š”์ง€. TASK ORDER๊ฐ€ ์žˆ์–ด์•ผํ•จ.

  3. primitve task unit ์— ๋Œ€ํ•œ ์ž‘์—… ํ• ๋‹น๊ณผ ์ž‘์—… ์™„๋ฃŒ ํ™•์ธ.

CORE ์ž‘์—…์€. File ์„ ์ ๋‹นํ•œ Task Unit ์œผ๋กœ ๋ถ„ํ• ํ•˜๋Š” ๋ฐฉ๋ฒ•.

export function parse_url(inputString: string){
const allowed_protocols = ["https", "http"];
let input_string = inputString;
let protocol = "";
let hostname:any = "";
let subdomain = "";
let domain = "";
let tld = "";
let paths = "";
<!DOCTYPE html>
<head>
<script type="module" src="./test.js"></script>
</head>
<body>
<child-child></child-child>
</body>
@dbwodlf3
dbwodlf3 / index.js
Last active May 18, 2022 03:46
URL Validation
function isUrl(inputString){
// Pattern 1 protocol://domain.tld/paths or protocol://subdomain.domain.tld/paths
// Pattern 2 domain.tld/paths
const allowed_protocols = ["http", "https"];
let input_string = inputString;
let protocol = "";
let hostname = "";
let subdomain = "";
@dbwodlf3
dbwodlf3 / algorithm.txt
Last active April 18, 2022 03:53
File Based Task
File Based Task
================================================================================
================================================================================
1. ํŒŒ์ผ ์ €์žฅ
error. Task ๋ฏธ๋“ฑ๋ก (Task ์ž์ฒด๊ฐ€ ์‹คํ–‰์ด ์•ˆ๋จ. File Upload Error)
2. Queueing
error. Task๊ฐ€ Queue์— ๋ˆ„๋ฝ๋จ.
recover. Task์˜ ์ด count ๊ฐ’๊ณผ, ์‹ค์ œ ์‹คํ–‰๋œ Task์˜ ์ด count ๊ฐ’์„ ๋น„๊ตํ•˜์—ฌ ๋ˆ„๋ฝ๋œ task
๊ฐ€ ์žˆ์Œ์„ ์ธ์ง€. ์‹คํ–‰๋œ Task์™€ ํŒŒ์ผ์˜ Task์„ ๋น„๊ตํ•˜์—ฌ ์–ด๋–ค ๊ฒƒ์ด ๋ˆ„๋ฝ๋˜์—ˆ๋Š”์ง€๋ฅผ ์•Œ ์ˆ˜ ์žˆ์Œ.
@dbwodlf3
dbwodlf3 / index.php
Created November 23, 2021 10:07
PHP Performance Time Check.
<?php
$global_time = new HRTime\StopWatch;
$global_time->start();
$time_1 = new HRTime\StopWatch;
$time_1->start();
//**********//
//**********//
$time_1->stop();
@dbwodlf3
dbwodlf3 / date.ts
Last active August 9, 2021 07:14
js short snippet related date
function getDateString(inputDate: Date) {
const date = inputDate;
return `${date.getFullYear()}-${date.getMonth()+1}-${date.getDate()}`;
}
function getCurrentDate() {
const date = new Date();
return `${date.getFullYear()}-${date.getMonth()+1}-${date.getDate()}`;
}
@dbwodlf3
dbwodlf3 / patterns.txt
Created December 28, 2020 00:48
patterns in smc LLVM IR
================================================================================
SMC Patterns in LLVM IR
================================================================================
1. Write Executable Memory
x86_smc1.out.ll
1.1. store ____, @data_memory
x86_smc3.out.ll
1.2. store ____, bitcast (@data_memory)
@dbwodlf3
dbwodlf3 / gcc_pattern.txt
Created December 28, 2020 00:45
gcc_pattern in smc LLVM IR
================================================================================
Jmp to Data(Call Data..)
================================================================================
Pattern 1. (PIE, NO-PIE ๊ด€๊ณ„ ์—†์Œ)
gcc_m64_PIE_smc10.ll(ํ•ด์•ผํ•  ๊ฒƒ. ๋ ˆ์ง€์Šคํ„ฐ ๋ถ„์„์„ ํ•ด์•ผํ•จ.)
(RBP์— ์ €์žฅ)
%1 = load i64, i64* @RSP_2312_55bbbb4f90b8, align 8, !tbaa !1240
%2 = add i64 %1, -8
%4 = sub i64 %2, 32