Skip to content

Instantly share code, notes, and snippets.

View tdchien's full-sized avatar
🛴
Working hard

Chien Tran tdchien

🛴
Working hard
View GitHub Profile
@spitfire05
spitfire05 / config.nu
Last active December 19, 2024 15:38
Nushell git aliases
def git_current_branch () {
git branch --show-current | str trim -c "\n"
}
alias s = git status -sb
alias g = git
alias ga = git add
alias gaa = git add --all
alias gapa = git add --patch
alias gau = git add --update
@HimDek
HimDek / Install Windows Subsystem for Android on any Edition of Windows 11 non Insider.md
Last active April 19, 2025 12:25
This Guide will show you how to Install Windows Subsystem for Android or WSA on any Edition of Windows 11 non Insider release.

Install Windows Subsystem for Android on Windows 11 non Insider

WSA or Windows Subsystem for Android is a Tool that allows Windows to run Android Apps directly without using any emulator. The problem is Windows Subsystem for Android is currently only available through preview via the Beta Channel of the Windows Insider Program. But if you follow this guide, you don't have to be in Windows Insider Program to try it out. The only thing you need is Windows 11 installed and some patience.

Prerequisites:

  • A Device with any version and Edition of Windows 11 installed.
  • Internet Connection.
  • Hyper-V enabled.

Enable Hyper-V:

@vinhjaxt
vinhjaxt / Rust install windows
Created August 26, 2021 10:46
Portable rust installation on windows
curl.exe https://static.rust-lang.org/dist/rust-nightly-x86_64-pc-windows-msvc.tar.gz
set "PATH=%PATH%;.\rust-nightly\rustc\bin"
set "PATH=%PATH%;.\rust-nightly\cargo\bin"
@son0nline
son0nline / VietNamChar.js
Created April 12, 2021 03:30
js: bỏ dấu Tiếng Việt
function removeVietnameseChar(str, bRPunctuations) {
// Bỏ các khoảng trắng liền nhau
str = str.replace(/ + /g, " ");
str = str.trim();
// Bỏ dấu tiếng Việt
str = str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g, "a");
str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g, "e");
str = str.replace(/ì|í|ị|ỉ|ĩ/g, "i");
str = str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g, "o");
@odan
odan / nginx-php-windows-setup.md
Last active March 21, 2025 08:06
Nginx and PHP Setup on Windows

Nginx and PHP Setup on Windows

For local development you could also use Nginx with PHP as an replacement for XAMPP.

Install Nginx

@mac641
mac641 / wsl_alpine-linux_docker-desktop.md
Last active February 10, 2025 03:15
Install Alpine Linux on WSL and connect it to Docker Desktop

Install Alpine Linux on WSL and connect it to Docker Desktop

  • Open an elevated PowerShell prompt.

Set up WSL and install AlpineWSL

  • Enable Windows Subsystem for Linux feature.
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
@HighwayStar
HighwayStar / buffer_fix.c
Last active April 15, 2025 12:39
xiaomi fix buffer issue (see line 83) in com.qti.chi.override.so
int __fastcall sub_81A44(int a1)
{
int v1; // ST84_4@4
int v2; // ST14_4@5
int v3; // ST10_4@5
int v4; // ST0C_4@5
int v5; // ST08_4@5
int v6; // ST00_4@5
int v7; // ST6C_4@7
int v8; // ST18_4@7
@rakeshsoni18
rakeshsoni18 / How to Load Custom Helper Function Globally?
Created November 19, 2019 19:27
How to Load Custom Helper Function Globally?
Using Composer to Autoload Files
First one is pretty easy and straightforward. Simply go to composer.json file located in your Laravel project and you will see autoload key. Composer has a files key (an array of file paths that you want to autoload) that you can use in your autoload key. It will look like this:
"autoload": {
"files": [
"app/Helpers/Helper.php"
],
"classmap": [
"database/seeds",
"database/factories"
@bmaupin
bmaupin / free-database-hosting.md
Last active April 19, 2025 04:46
Free database hosting
@Billz95
Billz95 / .php_cs.dist
Last active January 17, 2025 03:19
A Customised fixer for PHP-CS-Fixer to use `prettier`'s php plugin to pre-process the code before getting analysed by other fixers. This would enable `php-cs-fixer` to take advantage of `prettier`'s ability of managing long line.
<?php
require_once __DIR__.'/relative/path/to/PrettierPHPFixer/File';
return PhpCsFixer\Config::create()
->registerCustomFixers([
(new PrettierPHPFixer()),
])
->setRules([
'Prettier/php' => true,