Skip to content

Instantly share code, notes, and snippets.

View CSaratakij's full-sized avatar
🎯
Focusing

Chatchai Saratakij CSaratakij

🎯
Focusing
View GitHub Profile
using UnityEngine;
// Solves problem: HorizontalLayoutGroup successfully alignes children which present as it's children no matter visible they are or not.
// Visibility is controlled by Canvas Group's alpha value. That script just removes child from children list when alpha is 0. So that visible
// elements are aligned properly without gap
public class HorizontalLayoutGroupHelper : MonoBehaviour {
private CanvasGroup[] children;
private int[] siblingIndexes;
private Transform parentTransform;
@andrewrk
andrewrk / log.txt
Created January 8, 2016 13:31
conversation about fast int types in #musl irc channel
[16:00:47] <andrewrk> in practice, are the int_fastN_t types worth using?
[16:01:04] <andrewrk> what about cache performance?
[16:01:26] <nsz> no but it has nothing to do with technical reasons
[16:01:40] <andrewrk> go on?
[16:02:26] <nsz> the standard failed to clearly specify the intent of these types (is it for fast storage access, arithmetics,..?)
[16:03:00] <nsz> and the consequence is that implementations (glibc/gcc) made horrible choices (int_fast16_t is 64bit on 64bit machines)
[16:03:08] <andrewrk> ugh
[16:03:24] <andrewrk> well I'm playing with a toy language / compiler and I'm thinking about integer types
[16:03:24] <nsz> so a int_fast16_t division is much slower than an int16_t one
[16:03:36] <andrewrk> so what if we were to toss out the spec and imagine it better?
@subfuzion
subfuzion / github-wiki-how-to.md
Last active October 29, 2025 13:28
GitHub Wiki How-To

How do I clone a GitHub wiki?

Any GitHub wiki can be cloned by appending wiki.git to the repo url, so the clone url for the repo https://myorg/myrepo/ is: git@github.com:myorg/myrepo.wiki.git (for ssh) or https://github.com/my/myrepo.wiki.git (for https).

You make edits, and commit and push your changes, like any normal repo. This wiki repo is distinct from any clone of the project repo (the repo without wiki.get appended).

How do I add images to a wiki page?

@MattRix
MattRix / UnityEditorIcons.txt
Last active March 25, 2026 06:50
A list of all the built-in EdtiorGUI icons in Unity. Use EditorGUIUtility.IconContent([icon name]) to access them.
ScriptableObject Icon
_Popup
_Help
Clipboard
SocialNetworks.UDNOpen
SocialNetworks.Tweet
SocialNetworks.FacebookShare
SocialNetworks.LinkedInShare
SocialNetworks.UDNLogo
animationvisibilitytoggleoff
interface Fooable {
fun foo(): String
}
class FooImpl : Fooable {
override fun foo() = "I am fooImpl"
}
class AnotherFooImpl : Fooable {
override fun foo() = "I am anotherFooImpl"
@mnlwldr
mnlwldr / i3blocks.conf
Created June 25, 2016 15:19
Show the current active Window for i3blocks
[window_name]
command=xprop -id $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}') | awk '/_NET_WM_NAME/{$1=$2="";print}' | cut -d'"' -f2
interval=1
color=#ffffff
@benloong
benloong / UIDissolve.shader
Last active June 5, 2025 20:23 — forked from nukeop/dissolve.shader
Dissolve shader for Unity
Shader "UI/Dissolve"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0

Most active GitHub users in Thailand

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 29 Jul 2015 01:52:41 GMT till Fri, 29 Jul 2016 01:52:41 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user =&gt; user.followers &gt; 6)
@yujen
yujen / Sprites-Additive.shader
Last active March 31, 2025 18:22
Additive color tint sprite shader modified from Unity built-in Sprites-Default.shader
Shader "Sprites/Additive"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Additive Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
}
SubShader
@MightyPork
MightyPork / usb_hid_keys.h
Last active March 20, 2026 10:23
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/