Skip to content

Instantly share code, notes, and snippets.

View Roger-WIN's full-sized avatar

Roger Kung .WIN Roger-WIN

View GitHub Profile
@Roger-WIN
Roger-WIN / IntegratedServicesRegionPolicySet.json
Last active August 26, 2025 15:37
Windows 11 Version 24H2, C:\Windows\System32\IntegratedServicesRegionPolicySet.json
{
"$schema": "schemas/IntegratedServicesRegionPolicySet.Schema.1.1.0.json",
"version": "1.0",
"policies": [
{
"$comment": "Edge is uninstallable.",
"guid": "{1bca278a-5d11-4acf-ad2f-f9ab6d7f93a6}",
"defaultState": "disabled",
"conditions": {
"region": {
@Roger-WIN
Roger-WIN / IntegratedServicesRegionPolicySet.json
Last active August 26, 2025 14:40
Windows 10 Version 22H2, C:\Windows\System32\IntegratedServicesRegionPolicySet.json
{
"$schema": "schemas/IntegratedServicesRegionPolicySet.Schema.1.0.0.json",
"version": "1.0",
"policies": [
{
"$comment": "Edge is uninstallable.",
"guid": "{1bca278a-5d11-4acf-ad2f-f9ab6d7f93a6}",
"defaultState": "disabled",
"conditions": {
"region": {
@Roger-WIN
Roger-WIN / Microsoft.PowerShell_profile.ps1
Last active January 27, 2024 03:56
PowerShell Profile
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($Host.Name -eq 'ConsoleHost') {
Import-Module PSReadLine
}
Import-Module Terminal-Icons -ErrorAction SilentlyContinue
if (Get-Command oh-my-posh -ErrorAction SilentlyContinue) {
@Roger-WIN
Roger-WIN / task.json
Last active July 9, 2022 15:47
Build C++ in VS Code using Clang from MSYS2
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: clang++.exe build active file",
"command": "C:/Program Files/MSYS2/mingw64/bin/clang++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",
"${workspaceFolder}/*.cpp",
@Roger-WIN
Roger-WIN / compile_flags.txt
Last active June 20, 2021 01:21
clangd config file for simple C++ project using Clang from MYSY2. Placed in source root.
-Wall
-std=c++17
@Roger-WIN
Roger-WIN / cls
Last active April 23, 2020 02:34
Clear-screen shortcut command for Bash. Path of this file is "/usr/bin/cls".
#!/bin/bash
#
printf "\033c"
@Roger-WIN
Roger-WIN / static_access.js
Last active April 23, 2020 02:40
为了静态访问存储在 OSS 上的网页,请设法将该代码片段插入到网页的 HTML 代码中
/* 在页面的 URL 中添加页面的名称,以实现静态访问 */
(() => {
const url = window.location.href, // 当前页面的 URL
pathName = window.location.pathname;
const pageName = "index.html"; // 静态访问页面的名称
let newUrl; // 将要产生的 URL
let flag_append = '/', // 标志 1,表示目录
flag_insert = "/#"; // 标志 2,表示目录下的某级标题
if (url.endsWith(flag_append) && pathName != flag_append) // 以标志 1 结尾,且不是根目录
newUrl = url.concat(pageName); // 直接将页面名称追加到目录后