Skip to content

Instantly share code, notes, and snippets.

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

20chan 20chan

๐ŸŽธ
rockin'
View GitHub Profile
@20chan
20chan / readme.md
Last active February 4, 2026 19:53
์œ ๋‹ˆํ‹ฐ ์ง๋ ฌํ™” ๋ฐฉ์‹๊ณผ null ์‚ฌ์šฉ์˜ ๊ฐœ๊ฐ™์Œ๊ณผ ๋ฒ„๊ทธ

์œ ๋‹ˆํ‹ฐ์—์„œ Object ํด๋ž˜์Šค๋Š” (System.Object๊ฐ€ ์•„๋‹˜) == ์˜คํผ๋ ˆ์ดํ„ฐ์™€ implicit bool ์บ์ŠคํŒ… ์˜คํผ๋ ˆ์ดํ„ฐ๋ฅผ ์˜ค๋ฒ„๋ผ์ด๋“œํ•œ๋‹ค. ์ด๊ฒŒ ์ง„์ž ๋ง๋„ ์•ˆ๋œ๋‹ค

2018.3.0f2 ๋ฒ„์ ผ์ด๊ณ  ์ฝ”๋“œ๋Š” Jetbrain Rider ๋กœ ๋””์ปดํŒŒ์ผํ•œ ์ฝ”๋“œ๋ฅผ ์‚ฌ์šฉ

์ •์˜๋œ ์ฝ”๋“œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค:

public static bool operator ==(Object x, Object y)
{
  return Object.CompareBaseObjects(x, y);
@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 / ๊ธ€์ž.cs
Created September 9, 2017 18:14
ํ•œ๊ธ€ ์ฒ˜๋ฆฌ C# ํด๋ž˜์Šค
public struct ๊ธ€์ž
{
/// <summary>
/// ํ•œ๊ธ€์—ฌ๋ถ€(H, NH)
/// </summary>
public string ํ•œ๊ธ€์ธ๊ฐ€;
/// <summary>
/// ๋ถ„์„ ํ•œ๊ธ€
/// </summary>
public char ์›๋ž˜๊ธ€์ž;
@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 / fibonacci.cs
Created December 29, 2017 03:05
Calculating nth Fibonacci number with Generic class
using System;
namespace fibonacci_test
{
class Program
{
static int Fib(int n)
{
if (n <= 1) return 1;
return Fib(n - 2) + Fib(n - 1);
@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());