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 / AutoSnap.cs
Created October 10, 2015 05:11 — forked from estebanpadilla/AutoSnap.cs
Auto snap to grid in Unity If you need to auto snap a gameObject to the grid in unity this script will help you. Usage: Create a Editor folder in your assets folder. Add the AutoSnap.cs script to the Editor folder. To open press Command + L (Mal), Control + L (PC) Source: http://answers.unity3d.com/questions/148812/is-there-a-toggle-for-snap-to-…
using UnityEngine;
using UnityEditor;
public class AutoSnap : EditorWindow
{
private Vector3 prevPosition;
private bool doSnap = true;
private float snapValue = 1;
[MenuItem( "Edit/Auto Snap %_l" )]
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\Unity5]
@=""
"Icon"="%ProgramFiles%\\Unity\\Editor\\Unity.exe"
"MUIVerb"="Open as Unity Project"
[HKEY_CLASSES_ROOT\Folder\shell\Unity5\Command]
@="cmd /c start /D\"c:\\Program Files\\Unity\\Editor\\\" Unity.exe -projectPath \"%1\""
@CSaratakij
CSaratakij / CameraAnchor.cs
Created November 4, 2015 20:26 — forked from fadookie/CameraAnchor.cs
Screen-relative anchoring component for Unity3D
/***
* This script will anchor a GameObject to a relative screen position.
* This script is intended to be used with CameraFit.cs by Marcel Căşvan, available here: http://gamedev.stackexchange.com/a/89973/50623
*
* Note: For performance reasons it's currently assumed that the game resolution will not change after the game starts.
* You could not make this assumption by periodically calling UpdateAnchor() in the Update() function or a coroutine, but is left as an exercise to the reader.
*/
/* The MIT License (MIT)
Copyright (c) 2015, Eliot Lash
@CSaratakij
CSaratakij / gist:cd148cb82799619f70cb
Created February 24, 2016 13:52 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@CSaratakij
CSaratakij / gist:4ed1e681616a0e87f0ba6daa683277c4
Created April 24, 2016 18:05 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@CSaratakij
CSaratakij / tmux-cheatsheet.markdown
Created July 22, 2016 13:44 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@CSaratakij
CSaratakij / fbterm-hacks.md
Created July 24, 2016 09:00 — forked from zellio/fbterm-hacks.md
fbterm, installation and configuration hacks

fbterm setup and config hacks

Installation and setup

Install fbterm via your favorite package manager

pacman -S fbterm

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 => user.followers > 6)

Bomb Lab necessities

The bomb lab is most easily completed if you understand the following tools and commands. Also, if I am describing a program, assume that you run it from command line.

Strings

In case you have never used strings before it basically just tells you all the strings in an executable. If I were to run it on the bomb I would simply run

@CSaratakij
CSaratakij / tmux.conf
Created August 30, 2016 19:50 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000