Skip to content

Instantly share code, notes, and snippets.

View CSaratakij's full-sized avatar
🎯
Focusing

Chatchai Saratakij CSaratakij

🎯
Focusing
View GitHub Profile
@jdavid82
jdavid82 / .vimrc
Last active December 2, 2024 09:40
vim settings for full stack C# development in Windows 10
"Allow project specific .vimrc execution
set exrc
"no backup files
set nobackup
"only in case you don't want a backup file while editing
set nowritebackup
"no swap files
@enif-lee
enif-lee / CryptoUtil.cs
Created March 27, 2020 05:50
C# AES256 encryption and decryption example for using easily.
public class CryptoUtil
{
public static byte[] EncryptAes256(byte[] bytes, byte[] key)
{
using var aes = new RijndaelManaged
{
Key = CreateDeriveBytes(key, 32),
};
aes.GenerateIV();
@ZacharyPatten
ZacharyPatten / WindowsCmdCommand.cs
Created February 26, 2020 20:28
Example of running commands in Windows from C#
using System;
using System.Diagnostics;
class Program
{
static void Main()
{
WindowsCmdCommand.Run("dir", out string output, out string error);
Console.WriteLine("OUTPUT: " + output);
Console.WriteLine("ERROR: " + error);
@favoyang
favoyang / BuildAddressables.cs
Last active January 29, 2025 08:24
Build addressable bundles when clicking the build button
/// <summary>
/// The script gives you choice to whether to build addressable bundles when clicking the build button.
/// For custom build script, call PreExport method yourself.
/// For cloud build, put BuildAddressablesProcessor.PreExport as PreExport command.
/// Discussion: https://forum.unity.com/threads/how-to-trigger-build-player-content-when-build-unity-project.689602/
///
/// License: The MIT License https://opensource.org/licenses/MIT
/// </summary>
using UnityEditor;
using UnityEditor.AddressableAssets;
@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active August 2, 2025 20:45
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@arthuralvim
arthuralvim / queue_threading.py
Created February 21, 2019 17:18
Example of python queues and multithreading.
import queue
import threading
num_worker_threads = 1
def do_work(item):
print(item)
@debojyoti
debojyoti / lenovo_ideapad_330_ubuntu.md
Last active December 21, 2024 14:30
Lenovo ideapad 330 (15ARR) ubuntu issues and there solutions

Lenovo ideapad 330 (15ARR) ubuntu issues and their solutions

Issue-1: None of the ubuntu distros are getting installed

Solution: Ubuntu distros lower than 18.10 will not work in this laptop, as minimum kernal version required is 4.18.

So install ubuntu 18.10 / xubuntu 18.10 / lubuntu 18.10 / kubuntu 18.10 in UEFI mode

Issue-2: Wifi is not working

@tilkinsc
tilkinsc / sound.c
Created October 31, 2018 14:01
OpenAL how to load an Ogg Vorbis file and play it
// Created by: http://github.com/tilkinsc
// returns ALuint* aka a single openal buffer of ready-to-play ogg vorbis sound samples
// returns 0 on error
ALuint* sound_load_ogg(const char* path) {
ALenum error = 0;
ALuint* sound = 0;
FILE* fp = 0;
OggVorbis_File vf;
@nrtkbb
nrtkbb / maya2018install.sh
Last active June 19, 2023 08:25 — forked from borgfriend/maya2017install.sh
Maya 2018 Installation on Ubuntu 18.04
#!/bin/bash
#Make sure we’re running with root permissions.
if [ `whoami` != root ]; then
echo Please run this script using sudo
echo Just type “sudo !!”
exit
fi
#Check for 64-bit arch
if [uname -m != x86_64]; then
@mhingston
mhingston / AES.cs
Last active September 10, 2024 23:16
AES-256-CBC for C# and Node
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
class AES
{
public static string Encrypt(string plainText, string keyString)
{
byte[] cipherData;