Skip to content

Instantly share code, notes, and snippets.

View alexng353's full-sized avatar
:shipit:
Codexing :3

Alexander Ng alexng353

:shipit:
Codexing :3
View GitHub Profile
@alexng353
alexng353 / .nvimrc
Last active November 14, 2023 23:05
lazy.vim copilot configuration
filetype plugin indent on
" On pressing tab, insert 2 spaces
set expandtab
" show existing tab with 2 spaces width
set tabstop=2
set softtabstop=2
" when indenting with '>', use 2 spaces width
@alexng353
alexng353 / shell.rs
Last active November 16, 2023 02:32
[RUST] Determine current windows shell
/// get the parent process info, translated from
// https://gist.github.com/mattn/253013/d47b90159cf8ffa4d92448614b748aa1d235ebe4
fn get_parent_process_info() -> Option<(DWORD, String)> {
let mut pe32: PROCESSENTRY32 = unsafe { zeroed() };
let pid = unsafe { GetCurrentProcessId() };
let h_snapshot = unsafe { CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0) };
let mut ppid = 0;
if h_snapshot == INVALID_HANDLE_VALUE {
return None;
@alexng353
alexng353 / nextjs.yml
Last active May 19, 2025 11:56
Next JS build test GitHub action
name: Check NextJs build
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Runs on any open or reopened pull request
pull_request:
types: [opened, reopened] # you can change this according to https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#using-multiple-events