Skip to content

Instantly share code, notes, and snippets.

View hdavid0510's full-sized avatar
🐢
I may be slow to respond.

David.Hong hdavid0510

🐢
I may be slow to respond.
View GitHub Profile
@hdavid0510
hdavid0510 / wsl2-portforward.ps1
Last active September 17, 2023 06:06 — forked from hoonoh/wsl2-portforward.ps1
wsl2 port forwarding script
#DEBUG/ To check script running time
$start = Get-date
Write-Host "Obtaining WSL2 IP address" -foreground cyan;
$remoteAddr = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteAddr -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteAddr = $matches[0];
@hdavid0510
hdavid0510 / markdown-text-101.md
Created September 5, 2023 13:51 — forked from matthewzring/markdown-text-101.md
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

clc, clear, close('all')
%% PLOT
x = -4:0.1:8;
plot(x, ku2021_mech457_hw1_q8_f(x))
xlabel('x'); ylabel('y');
title('f(x) = -0.6*x^2 + 2.4*x + 5.5');
hold on, plot([x(1), x(end)], [0,0], 'k')
clear x
@charset "UTF-8";
/*
* 글자 크기를 12px(최소)로 설정하시면 실제 인게임 크기가 됩니다.
* 트윕(TWIP) 기본 ffxiv 테마에서 디테일을 약간 수정하였습니다.
*/
:root{
--twip-font-size: $font_sizepx
}
a=0
b=0
c=0
d=0
e=0
f=0
t=0
@hdavid0510
hdavid0510 / RPi_I2C_driver.py
Created July 8, 2020 19:21 — forked from DenisFromHR/RPi_I2C_driver.py
RaspberryPi I2C LCD Python stuff
# -*- coding: utf-8 -*-
"""
Compiled, mashed and generally mutilated 2014-2015 by Denis Pleic
Made available under GNU GENERAL PUBLIC LICENSE
# Modified Python I2C library for Raspberry Pi
# as found on http://www.recantha.co.uk/blog/?p=4849
# Joined existing 'i2c_lib.py' and 'lcddriver.py' into a single library
# added bits and pieces from various sources
# By DenisFromHR (Denis Pleic)
@hdavid0510
hdavid0510 / sources.list
Created June 10, 2020 08:21
Ubuntu 18.04 default sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted
@hdavid0510
hdavid0510 / WindowsTerminal_ContextMenu.reg
Last active June 11, 2020 17:54
Windows Terminal contextmenu shortcut. 1) Windows Terminal from Microsoft Store should be installed 2) PsExec64 should be accessible by adding PATH or modding path to PsExec64.exe on reg file 3) Change [[USERNAME]] to actual username before run.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\WindowsTerminal]
@="Open Windows Terminal here"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\WindowsTerminal\command]
@="C:\\Users\\ [[USERNAME]] \\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\WindowsTerminalAdmin]
@hdavid0510
hdavid0510 / omok.c
Created April 26, 2017 05:46
오목게임 소스입니다. 배열을 통해 오목판을 구현하였고, 오목판 배열의 주솟값과 커서 배열(X, Y)의 두 좌푯값을 대응시켜서 커서를 구현했습니다. 오목칸 사이사이의 넓이가 넓은 오목판과 좁은 오목판이 있으며 이는 주석처리를 통해 원하는 오목판 그리기 함수를 고름으로써 취사선택할 수 있습니다. 육목 이상의 판정은 승리로 인정되지 않으며, 3-3금지는 아직 구현하지 못했습니다.
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#define UP 72
#define LEFT 75
#define DOWN 80
#define RIGHT 77
#define SPACE 32
#define ENTER 13