Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Chatchai Saratakij CSaratakij

🎯
Focusing
View GitHub Profile
@CSaratakij
CSaratakij / README.txt
Last active Jul 26, 2020
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 Feb 27, 2020
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 — 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 Apr 10, 2019
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 Mar 16, 2019 — 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 Jul 12, 2020
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
View reverse_array.py
def main():
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]
print("Before reverse : ")
print(numbers)
numbers = reverse_array(numbers)
print("")
View shuffle_sorted_array.py
import random
def main():
random.seed()
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
print("Before shuffle : " + str(numbers))
numbers = shuffle(numbers)
print("After shuffle : " + str(numbers))
View CustomCollision.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class CustomCollision : MonoBehaviour
You can’t perform that action at this time.