Skip to content

Instantly share code, notes, and snippets.

View daanta-real's full-sized avatar
๐Ÿ”ฅ

Junsung Park / Daanta daanta-real

๐Ÿ”ฅ
View GitHub Profile
@daanta-real
daanta-real / show_draggable_image.memo
Created April 15, 2026 12:06
The command to show an draggable image on the desktop in Windows
# The command to show an draggable image on the desktop in Windows.
# type: cmd
# replace "YOUR_IMAGE_PATH" to your image path.
powershell -sta -c "Add-Type -A System.Windows.Forms;$f=New-Object Windows.Forms.Form;$f.FormBorderStyle='None';$f.BackColor=$f.TransparencyKey=[Drawing.Color]::Magenta;$f.TopMost=1;$f.StartPosition='CenterScreen';$p=New-Object Windows.Forms.PictureBox;$p.Image=[Drawing.Image]::FromFile('YOUR_IMAGE_PATH');$p.SizeMode='AutoSize';$p.BackColor=[Drawing.Color]::Magenta;$d=$false;$ox=0;$oy=0;$p.Add_MouseDown({$script:d=$true;$script:ox=$_.X;$script:oy=$_.Y});$p.Add_MouseMove({if($script:d){$f.Left+=$_.X-$script:ox;$f.Top+=$_.Y-$script:oy}});$p.Add_MouseUp({$script:d=$false});$p.Add_DoubleClick({$f.Close()});$f.Controls.Add($p);$f.Size=$p.Image.Size;$f.ShowDialog()"
@daanta-real
daanta-real / touchpad_toggler.ps
Created February 16, 2026 09:59
Windows 11 Touchpad Toggler
# Touchpad Toggler
# ํ„ฐ์น˜ํŒจ๋“œ ํ† ๊ธ€ํ•˜๊ธฐ ์Šคํฌ๋ฆฝํŠธ
Add-Type -AssemblyName UIAutomationClient
Add-Type -AssemblyName UIAutomationTypes
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public class WindowMover {
@daanta-real
daanta-real / CUSTOM_STYLESHEET_FORCE_INJECTION.JS
Last active March 7, 2025 14:44
CSS stylesheet forced replacement injection source snippet
document.head.appendChild(Object.assign(document.createElement('style'), { innerHTML: `
/*********************************************/
/* PUT YOUR ADDITIONAL CUSTOM CSS STYLESHEET */
/* HERE AS WHATEVER YOU WANT. START */
/*********************************************/
body.android .photoFrame .smileCnt i.smile {
top:0.05em;
}
.photoFrame .smileCnt .smileCntTxt {
@daanta-real
daanta-real / varNmConv.js
Last active January 1, 2025 18:46
๋ณ€ํ™˜๊ธฐ: kebob-case/camelCase/snake_case ํ˜•์‹ ๊ฐ„ ๋ณ€ํ™˜
// ์ผ€๋ฐฅ์ผ€์ด์Šค, ์Šค๋„ค์ดํฌ์ผ€์ด์Šค, ์นด๋ฉœ์ผ€์ด์Šค ๋ณ€ํ™˜ ํ•จ์ˆ˜ (DB์šฉ ์ปฌ๋Ÿผ๋ช…๋„ ์ฒ˜๋ฆฌ)
function convertCase(str) {
// ํƒญ ๊ตฌ๋ถ„๋œ ๋ฌธ์ž์—ด ์ฒ˜๋ฆฌ
return str.includes('\t')
? str.split('\t').map(convertCase).join('\t') // ํƒญ์œผ๋กœ ๋ถ„๋ฆฌ๋œ ๋ฌธ์ž์—ด์— ๋Œ€ํ•ด ๋ฐ˜๋ณต ์ฒ˜๋ฆฌ
: (str.includes('-') || str.includes('_') // ์ผ€๋ฐฅ์ผ€์ด์Šค ๋˜๋Š” ์Šค๋„ค์ดํฌ์ผ€์ด์Šค
? str.toLowerCase().replace(/[-_](.)/g, (m, c) => c.toUpperCase()) // ์ผ€๋ฐฅ/์Šค๋„ค์ดํฌ -> ์นด๋ฉœ
: str.replace(/([a-z])([A-Z])/g, '$1_$2').toUpperCase()); // ์นด๋ฉœ -> DB์šฉ(์Šค๋„ค์ดํฌ)
}
@daanta-real
daanta-real / POW_BigDecimal.java
Created May 13, 2024 17:11
POW with 2 BigDecimal instances. yeah
package y24.m05.d13.c01_BigDecimal_exp;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
@Slf4j
@daanta-real
daanta-real / random password.js
Created April 27, 2024 13:49
random password generator
function generateRandomPassword(length) {
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_+=[]{}|;:,.<>? ";
let password = "";
for (let i = 0; i < length; i++) {
const randomIndex = Math.floor(Math.random() * charset.length);
password += charset[randomIndex];
}
return password;
}
var a1;
var a2 = [];
var a3 = {};
var a4 = {x:undefined};
var a5 = {x:'1'};
console.log("a1:", a1?.x || 'error');
console.log("a2:", a2?.x || 'error');
console.log("a3:", a3?.x || 'error');
console.log("a4:", a4?.x || 'error');
@daanta-real
daanta-real / dbColsToVOVarNames.js
Last active April 11, 2023 03:15
Convert DB column name to camelCase for using their names in VO
function toCamelCase(str){
var regExp=/[-_]\w/ig;
return str.toLowerCase().replace(regExp,function(match){
return match.charAt(1).toUpperCase();
});
}
function toCamelCaseList(arr) {
let result = [];
arr = arr.split("\n");
for(var a of arr) {
@daanta-real
daanta-real / DebugPopup.html
Last active April 4, 2023 01:16
Debug informimg popup boilerplate
<Style type="text/css">
pre { display:none; background:red; color:white; font-weight:bold; padding:5px; width:850px; }
</Style>
<pre id="debugPre" style="display:none;">
Your debugging HTML HERE
</pre>
<script type="text/javascript">
@daanta-real
daanta-real / PrintFormData.js
Last active March 6, 2023 02:28
Read and print all form data to console
function printFormData(formId) {
const formEl = document.getElementById(formId);
const formData = new FormData(formEl);
const params = {};
for(const [key, val] of formData.entries()) {
params[key] = val;
}