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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.