Skip to content

Instantly share code, notes, and snippets.

@muedsa
muedsa / BTDeviceBatteryLevel.ps1
Created September 22, 2023 09:54
获取WMI中的蓝牙设备电量
# ATTENTION: Don't forget to allow the powershell script to run first.
# Here is a step by step of how to execute this script:
# - Open a Powershell command prompt.
# - Allow shel script execution with command:
# Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
# - Execute the current powershell script with the command:
# .\GetBatteryLevel_DOQAUS-CARE1v1.ps1
# - The results may take some time to come. A pop-up will show on your
# main screen. You must click 'Ok' to unblock the Powershell command prompt.
@muedsa
muedsa / hotspot.cmd
Created April 23, 2023 02:11 — forked from primaryobjects/hotspot-keep-alive.ps1
Script to Enable Windows 10 Mobile Hotspot Automatically After Reboot
PowerShell -Command "Set-ExecutionPolicy Unrestricted" >> "%TEMP%\StartupLog.txt" 2>&1
PowerShell C:\Users\YOUR_USERNAME\Desktop\hotspot.ps1 >> "%TEMP%\StartupLog.txt" 2>&1
@muedsa
muedsa / languages-and-vms.md
Created March 10, 2023 08:23 — forked from haxscramper/languages-and-vms.md
languages-and-vms
@muedsa
muedsa / d_pad_control_focus.dart
Created January 16, 2023 08:17
D-Pad Control Widget for Flutter
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
class DPadControlShortcuts extends StatelessWidget {
const DPadControlShortcuts({required this.child, super.key});
final Widget child;
@override
Widget build(BuildContext context) {
// ==UserScript==
// @name grafana loki query remove bom
// @namespace https://www.muedsa.com
// @version 0.1
// @description try to take over the world!
// @author MUEDSA
// @match https://test-grafana.fskops.com/explore?*
// @run-at document-start
// @grant unsafeWindow
// ==/UserScript==
export class RegexHtmlElement {
static SPACE_EXIST_MATCH_REGEX = '\\s+?';
static SPACE_MATCH_REGEX = '\\s*?';
static LINE_MATCH_REGEX = '.*?';
static ALL_MATCH_REGEX = '[\\s\\S]*?';
static BEGIN_TAG_LEFT = '<';
static END_TAG_LEFT = '</';
static TAG_RIGHT = '>'
static SELF_CLOSE_TAG_RIGHT = '/>'
@muedsa
muedsa / app.vue
Created January 24, 2022 05:11
debounc throttle by Proxy
<template>
<div id="app">
<test-component></test-component>
<test-component></test-component>
</div>
</template>
import TestComponent from 'test-component'
<script>
export default {
components: {
@muedsa
muedsa / gist:cd2b1a504ee9155e8dcb2cc7c62257d7
Last active October 23, 2019 05:59
BluetoothInfoTest
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
namespace BluetoothBatteryTest
{
class SetupAPI
@muedsa
muedsa / Wbe-JS-SandBox.markdown
Last active August 23, 2019 07:25
Wbe-JS-SandBox
@muedsa
muedsa / gist:ffadc69fb99386084efc50a3c9e8bc32
Created December 4, 2018 06:03
Oracle Import table structure
select t1.COLUMN_ID 序号,
t1.COLUMN_NAME 列名,
decode(t1.DATA_TYPE,
'NUMBER',
decode(t1.DATA_PRECISION,
null,
decode(t1.DATA_SCALE, 0, 'INTEGER', 'NUMBER'),
'NUMBER'),
t1.DATA_TYPE) 数据类型,
decode(t1.DATA_TYPE, 'NUMBER', t1.DATA_PRECISION, 'DATE', '', t1.DATA_LENGTH) 长度,