Skip to content

Instantly share code, notes, and snippets.

View issaclin32's full-sized avatar
💭
Speaks Chinese, Japanese and some Thai.

Issac Lin issaclin32

💭
Speaks Chinese, Japanese and some Thai.
View GitHub Profile
# useage:
# scoop-import <exported_list_file>
param(
$exported
)
$apps = (
Get-Content -Path $exported | Select-String '(?<app>.*)\s\(v:(?<version>.*)\)\s\[(?<bucket>.*)\]' -AllMatches |
Foreach-Object {$_.Matches} |
Foreach-Object {($_.Groups["bucket"].Value)+"/"+($_.Groups["app"].Value)}
@alphp
alphp / NativeMethods.psm1
Created August 27, 2018 04:08
PowerShell module for send WM_SETTINGCHANGE after change Environment variables in Windows
Add-Type -Namespace Win32 -Name NativeMethods -MemberDefinition @"
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern IntPtr SendMessageTimeout(IntPtr hWnd, uint Msg, UIntPtr wParam, string lParam, uint fuFlags, uint uTimeout, out UIntPtr lpdwResult);
"@
function Send-SettingChange {
$HWND_BROADCAST = [IntPtr] 0xffff;
$WM_SETTINGCHANGE = 0x1a;
$result = [UIntPtr]::Zero
@SalviaSage
SalviaSage / Correct Registry Syntax.md
Last active May 25, 2024 05:05
Guide on Editing the Windows Registry.

Last Revised: 2021-04-29 (added the section about file creation and default file naming.)

I made this guide to help me or anyone else who is interested in editing the Windows Registry.

It is possible to modify the entries of the Windows Registry. To do this, you need to create a file that ends with the extension .reg.


.reg file encoding:

@akhenakh
akhenakh / guess.go
Last active March 13, 2024 13:18
Guess an image format in Golang
package main
import (
"image"
_ "image/gif"
_ "image/jpeg"
_ "image/png"
"io"
"mime"