Skip to content

Instantly share code, notes, and snippets.

View CSaratakij's full-sized avatar
🎯
Focusing

Chatchai Saratakij CSaratakij

🎯
Focusing
View GitHub Profile
@CSaratakij
CSaratakij / bspwmrc
Created March 16, 2019 21:48 — forked from TiZ-HugLife/bspwmrc
bspwm config files
#! /bin/sh
bspc config top_padding 24
bspc config bottom_padding 0
bspc config left_padding 0
bspc config right_padding 0
bspc config border_width 3
bspc config window_gap 16
# Borders and gaps
@CSaratakij
CSaratakij / solution.md
Last active December 9, 2024 03:49
SQL query practice : 6002526

SQL query practice : (6002526)

Lesson 1 : SELECT queries 101

  1. Find the title of each film
SELECT title FROM movies;
  1. Find the director of each film
@CSaratakij
CSaratakij / README.txt
Last active October 5, 2024 10:43
Video Wallpaper (hw-accelerate) : Use 'mpv' as a video player backend with 'xwinwrap' to wrap our window to be use as a desktop background
You want to use a live wallpaper in x11?
Great!!...but It come as a cost.
I did experiment with .gif backend and non hardware accelerate backend, It sucks.
CPU usage was so high (40% up just for idle), unacceptable for my laptop.
Running with those backend for such a really long time will slowly turn your laptop into the hot potato.
But don't be upset, we can reduce those cost.
Using the video player with hardware video decoding support can reduce the cost.
@CSaratakij
CSaratakij / BuildTypeEditorWindowTitleStatus.cs
Last active September 30, 2024 07:15
Quick change unity player setting build type from Mono to IL2CPP menu item "Help/Quick change build type/..."
/*
Note : adhocs for unity 2022.3.31
TODO : Need to Support Unity 6 with the new callback : https://docs.unity3d.com/6000.0/Documentation/ScriptReference/EditorApplication.UpdateMainWindowTitle.html
and the new force update window title method : https://docs.unity3d.com/6000.0/Documentation/ScriptReference/EditorApplication.UpdateMainWindowTitle.html
*/
#if UNITY_2022_3_31
#define EDITOR_ALLOW_BUILDTYPE_STATUS
#endif
@CSaratakij
CSaratakij / .tmux.conf
Last active June 22, 2024 08:10
Tmux's Config that's very close to i3wm (Setting with an idea of using tmux without x-server)
# Config that is very close to a i3 window manager's keybinding.
set -s escape-time 0
setw -g aggressive-resize on
# First remove *all* keybindings
unbind-key -a
# List keys
bind-key ? list-keys
@CSaratakij
CSaratakij / SceneViewFollowGamePlayCameraEditorTools.cs
Created May 25, 2024 11:46
Custom Editor Toolbar to make SceneView follow game play camera (Current "main camera")
using UnityEngine;
using UnityEditor;
using UnityEditor.Overlays;
using UnityEditor.Toolbars;
#if !UNITY_EDITOR
#error This script must be placed under "Editor/" directory.
#endif
[Overlay(typeof(SceneView), "CustomToolbar/SceneViewFollowGamePlayCameraOverlay")]
@CSaratakij
CSaratakij / SkinnedMeshUpdater.cs
Created September 22, 2023 08:42 — forked from tsubaki/SkinnedMeshUpdater.cs
update SkinnedMesh
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.Assertions;
using System;
public class SkinnedMeshUpdater : MonoBehaviour
{
[SerializeField]
SkinnedMeshRenderer original;
@CSaratakij
CSaratakij / unityPlayer.cs
Created June 20, 2023 10:09 — forked from Oleur/unityPlayer.cs
Get current Android activity and init an Android object from Unity
AndroidJavaObject localMediaPlayer = null;
using (AndroidJavaClass javaUnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
{
using (currentActivity = javaUnityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
{
localMediaPlayer = new AndroidJavaObject("my/plugin/vr/ExoPlayerBridge", currentActivity);
if (localMediaPlayer != null)
{
@CSaratakij
CSaratakij / remover.py
Last active February 28, 2023 22:35
Json comment remover '//'
#!/usr/bin/env python3
import argparse
from pathlib import Path
commentSymbol = "//"
parser = argparse.ArgumentParser(description="Remove comment from json.")
parser.add_argument("input", help="input file path")
parser.add_argument("output", help="output file path")
@CSaratakij
CSaratakij / AssetImportLogger.cs
Created March 28, 2022 07:14
Asset Import Logger (for re-import issue)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class AssetImportLogger : AssetPostprocessor
{
public const string IS_ENABLE_KEY = "KEY_ASSET_IMPORT_LOGGER_IS_ENABLE";
public const string IS_START_KEY = "KEY_ASSET_IMPORT_LOGGER_IS_START";
public const string LOG_FORMAT = "path '{0}'";