Skip to content

Instantly share code, notes, and snippets.

View 20chan's full-sized avatar
๐ŸŽธ
rockin'

20chan 20chan

๐ŸŽธ
rockin'
View GitHub Profile
@20chan
20chan / resize_video.sh
Created July 27, 2022 10:25
์• ํ”Œ ์•ฑ์Šคํ† ์–ด ์˜์ƒ์œผ๋กœ ์“ธ ์ž๋™ ๋ฆฌ์‚ฌ์ด์ฆˆ/ํฌ๋กญ ์Šคํฌ๋ฆฝํŠธ
set -ex
FILE=$1
WIDTH=$2
HEIGHT=$3
OUTPUT=$4
function resize() {
WIDTH=$1
@20chan
20chan / pre-commit
Last active April 13, 2023 06:40
git hook for unstaging unity empty directory meta files
#!/bin/bash
function is_empty()
{
if [[ "$1" == *.meta ]]; then
filename="${file%.meta}"
if [[ -d "$filename" ]]; then
files=$(git ls-files "$filename")
if [ -z "$files" ]; then
return
@20chan
20chan / webhook.sh
Created June 19, 2020 09:14
ifttt webhook script
#!/bin/bash
_usage() {
echo "Usage: $0 <event> [value1] [value2] [value3]"
}
if [ -z "$1" ]; then
_usage
exit 1
fi
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using Microsoft.CSharp;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
@20chan
20chan / DoomFromScratch.cs
Created March 15, 2020 09:23
doom from scratch - 2018/04/21
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@20chan
20chan / wow.md
Last active February 25, 2020 11:40
๊ฐœ๊ฐ€ํ„ด ์œ ๋‹ˆํ‹ฐ ์”ฌ๋ทฐ ๋Š๋ ค์ง€๋Š” ๋ฒ„๊ทธ

์–ธ์  ๊ฐ€๋ถ€ํ„ฐ ์œ ๋‹ˆํ‹ฐ ์”ฌ๋ทฐ๋ฅผ ์ผœ๋‘๋ฉด ์œ ๋‹ˆํ‚ค๊ฐ€ ๋„ˆ๋ฌด ๋Š๋ ค์ ธ์„œ ์”ฌ๋ทฐ๋ฅผ ๋„๊ณ  ๊ฒŒ์ž„๋ทฐ๋งŒ ์ผœ๋‘๊ณ  ํ…Œ์ŠคํŠธ๋ฅผ ๋Œ๋ ธ๋‹ค ์ด๊ฒŒ ๋„ˆ๋ฌด ๋ถˆํŽธํ•ด์„œ ์›์ธ์„ ์ฐพ์•„๋ณด๋ ค๊ณ  ํ–ˆ๋‹ค

์ผ๋‹จ ํ”„๋กœํŒŒ์ผ๋Ÿฌ๋กœ ์ฐ์–ด๋ณด๋ฉด ๋‹ค์Œ์ฒ˜๋Ÿผ ๋‚˜์™”๋‹ค

problem

์”ฌ๋ทฐ Repaint๋ฅผ ํ•˜๋Š”๋ฐ SceneCamera.Finish ๋ž€ ๋†ˆ์ด ์‹œ๊ฐ„์„ ์–ด๋งˆ๋ฌด์ง€ํ•˜๊ฒŒ ์žก์•„๋จน๊ณ ์žˆ์Œ ์ƒ์‹์ ์œผ๋กœ ์ƒ๊ฐํ•ด๋„ ๋ญ”๊ฐ€ ๋ฌธ์ œ๊ฐ€ ์žˆ๋‹คํ•ด๋„ ๋ Œ๋” ์‹œ๊ฐ„์ด ๊ธธ์–ด์•ผ ํ•  ๊ฒƒ ๊ฐ™์€๋ฐ ๋ Œ๋” ์‹œ๊ฐ„์€ ์ •์ƒ์ด๊ณ  Finish ํ•˜๋Š”๋ฐ๋งŒ ์‹œ๊ฐ„์ด ์ €๋ ‡๊ฒŒ? ์•„๋ฌด๋ฆฌ ์ž˜ ๊ฒ€์ƒ‰ํ•ด๋ด๋„ ๊ฒฐ๊ณผ๊ฐ€ ๋„์ €ํžˆ ๋‚˜์˜ค์ง€ ์•Š์•˜๊ณ  (ํ•˜๋‚˜ ์žˆ์—ˆ๋Š”๋ฐ ์งˆ๋ฌธ๊ธ€ ํ•˜๋‚˜๋งŒ ์žˆ์—ˆ์Œ) ๊ทธ๋ฆฌ๊ณ  ๋น„์ƒ์‹์ ์œผ๋กœ ๋””์Šค์–ด์…ˆ๋ธ”๋ฆฌํ•œ๊ฑธ ๊ณ„์† ๋œฏ์–ด๋ด๋„ ๋”ฑํžˆ ๋‹ค๋ฅธ๊ฒŒ ์—†์—ˆ๋‹ค

@20chan
20chan / DamnUnityCoroutine.cs
Last active February 17, 2020 09:58
Unity StopCoroutine doesn't work at all in nested Coroutine but it is ambiguous
using System.Collections;
using Sirenix.OdinInspector;
using UnityEngine;
public class DamnUnityCoroutine : MonoBehaviour {
private Coroutine coroutine;
[Button(ButtonSizes.Large)]
public void Go() {
coroutine = StartCoroutine(A());
@20chan
20chan / register.py
Created February 5, 2020 16:20
python custom codec meta programming post example aheui code
import codecs, io, encodings
from encodings import utf_8
aheui_code = '''
'''
def aheui_decode(input, errors="strict"):
raw = bytes(input).decode("utf-8")
code = "\n".join(raw.splitlines()[1:])
hooked = aheui_code + f'eval("""{code}""")'
@20chan
20chan / readme.md
Created November 29, 2019 02:48
Use RadialController (and other UWP apis) in winform

UWP in Winform

์›๋ž˜ TargetPlatform์„ 8 ์ด์ƒ์œผ๋กœ ํ•˜๊ณ  Windows SDK๊ฐ€ ๊น”๋ ค์ž‡๋‹ค๋ฉด VS ์ฐธ์กฐ ํƒญ์—์„œ ์™ผ์ชฝ์— Windows SDK๊ฐ€ ๋œจ๊ณ  ๊ฑฐ๊ธฐ์— dll๋“ค์ด ๋œจ๋‚˜๋ณด๋‹ค ๊ทผ๋ฐ Windows SDK๋งŒ ๋œจ๊ณ  ์•ˆ์— ์—†๋‹ค๊ณ  ๋œธ SDK๋„ ์„ค์น˜๋˜์–ด์žˆ๋Š”๋ฐ

๊ทธ๋ž˜์„œ ์ฐพ์•„๋ณด๋‹ˆ๊นŒ https://developercommunity.visualstudio.com/content/problem/608833/no-references-were-found-in-the-windows-sdk.html ์ด๊ฒŒ ์œˆ๋„์šฐ 1903 ๋ฒ„๊ทธ๋ผ๊ณ  ์‹ฌ์ง€์–ด ํ•œ ์Šคํƒ์˜ค๋ฒ„ํ”Œ๋กœ์šฐ ์งˆ๋‹ต ์—์„œ๋Š” ์œˆ๋„์šฐ๋ฅผ 1803์œผ๋กœ ๋‹ค์šด๊ทธ๋ ˆ์ด๋“œํ•˜์„ธ์š”! ๋ผ๋Š” ๋‹ต๋ณ€์ด ์ฑ„ํƒ๋˜์—ˆ๋‹ค

@20chan
20chan / ytmusic.ipynb
Created November 13, 2019 01:53
dotnet try jupyter notebook example for C# youtube music control with Puppeteersharp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.