Skip to content

Instantly share code, notes, and snippets.

View JamesKim2998's full-sized avatar

James Kim (Daewon) JamesKim2998

View GitHub Profile
call plug#begin('~/.config/nvim/plugged')
" appearance
Plug 'altercation/vim-colors-solarized'
Plug 'nathanaelkane/vim-indent-guides'
" git
Plug 'tpope/vim-fugitive'
Plug 'vim-airline/vim-airline'
Plug 'airblade/vim-gitgutter'
class SomeScriptableObject : ScriptableObject
{
[SerializeField]
AssetReference _someAssetRef;
void DoSomething()
{
Addressables.LoadAssetAsync<Object>(_someAssetRef).Completed += asset =>
{
// Do something
public struct CustomVector2
{
public int X;
public int Y;
public CustomVector2(int x, int y)
{
X = x;
Y = y;
}
using Core;
using Services;
using Sirenix.OdinInspector;
namespace App
{
public class IOCContainer
{
// Common.
[ShowInInspector, HideReferenceObjectPicker]
@JamesKim2998
JamesKim2998 / mousehighlight.lua
Created April 22, 2018 04:47
my hammer spoon utils.
local fps = 120
local pangSpeed = 120
local fadeDuration = 0.4
local dt = 1 / fps
local fadePerSecond = 1 / fadeDuration
function easeInExpo(t, b, c, d)
return c * 2^(10 * (t/d - 1)) + b
end
@JamesKim2998
JamesKim2998 / EnumAsMetricBenchmark.cs
Created October 10, 2017 08:58
Performance comparison between int and enum.
using System;
using UnityEngine;
using UnityEngine.UI;
/******** Result *********
* TestIntConversion: .0032730
* TestEnumConversion: .0029910
* TestIntOp: .0027300
* TestEnumOp: .0030000 <- always lose :(
* TestIntToString: .3037160
@JamesKim2998
JamesKim2998 / Foo1ChildWrap.cs
Last active May 6, 2017 06:59
automatic lua binding by xLua
#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif
@JamesKim2998
JamesKim2998 / pvr2png.py
Created March 24, 2017 03:18
Convert pvr file to png using TexturePacker.
#!/usr/local/bin/python3
import sys
import os
from glob import glob
from subprocess import call
def log(msg):
print('[PVR2PNG] ' + msg)
root = sys.argv[1]
#!/bin/sh
if [ ! -d "$1" ]; then
echo Usage: $(basename "$0") BOOKDIR \> trpl.md
echo Then: pandoc -S -o trpl.epub trpl.md
exit 1
fi
cat "$1/README.md"
echo