Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Chatchai Saratakij CSaratakij

🎯
Focusing
View GitHub Profile
@CSaratakij
CSaratakij / remover.py
Last active April 28, 2022 13:23
Json comment remover '//'
View remover.py
#!/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)
View AssetImportLogger.cs
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}'";
@CSaratakij
CSaratakij / introrx.md
Created October 1, 2020 04:51 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
@CSaratakij
CSaratakij / README.txt
Last active October 15, 2022 03:49
Video Wallpaper (hw-accelerate) : Use 'mpv' as a video player backend with 'xwinwrap' to wrap our window to be use as a desktop background
View README.txt
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.
View example.cs
using UnityEngine;
public class Example : MonoBehavoiur
{
[SerializeField]
GameObject prefab;
bool isTrigger = false;
void OnTriggerEnter(Collider col)
@CSaratakij
CSaratakij / utils.cs
Created February 27, 2020 10:47
Shuffle sample (Generic)
View utils.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Utils : MonoBehaviour
{
int[] numbers = new int[] {
1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0
};
@CSaratakij
CSaratakij / TriggerContainerEditor.cs
Last active May 18, 2019 09:21 — forked from bzgeb/TriggerContainerEditor.cs
Example Drag & Drop area in a custom inspector for the Unity editor
View TriggerContainerEditor.cs
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor (typeof(TriggerContainer))]
public class TriggerContainerEditor : Editor
{
private SerializedObject obj;
@CSaratakij
CSaratakij / PDF_To_JPG
Last active April 10, 2019 05:36
Nautilus convert .pdf to .jpg script intregation (multiple select files support)
View PDF_To_JPG
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
COUNTER=0
echo -e "Start converting files..."
notify-send "Start converting files..."
for path in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do
@CSaratakij
CSaratakij / bspwmrc
Created March 16, 2019 21:48 — forked from HugLifeTiZ/bspwmrc
bspwm config files
View bspwmrc
#! /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 January 13, 2023 11:26
SQL query practice : 6002526
View solution.md

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