Skip to content

Instantly share code, notes, and snippets.

View huihut's full-sized avatar
🌴
On vacation

huihut huihut

🌴
On vacation
View GitHub Profile
@huihut
huihut / Windows10-professional-activation.md
Created August 2, 2018 09:32
Windows10 专业版 激活方法
  1. 以管理员身份运行CMD
  2. slmgr.vbs /upk
  3. slmgr /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX
  4. slmgr /skms zh.us.to
  5. slmgr /ato
@huihut
huihut / SQLiteHelper.cs
Created March 18, 2019 02:37
C# SQLiteHelper 数据库操作类
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SQLite;
/// <summary>
/// 数据库操作类
/// </summary>
public sealed class SQLiteHelper
{
@huihut
huihut / ActivationOffice2016.cmd
Created September 24, 2018 17:05
Office 2016 激活,以管理员身份运行此cmd文件
@echo off
title Activate Microsoft Office 2016 ALL versions for FREE!&cls&echo ============================================================================&echo #Project: Activating Microsoft software products for FREE without software&echo ============================================================================&echo.&echo #Supported products:&echo - Microsoft Office Standard 2016&echo - Microsoft Office Professional Plus 2016&echo.&echo.&(if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&echo.&echo ============================================================================&ech
@huihut
huihut / launch.json
Created June 12, 2018 09:11
Configuring launch.json for C/C++ debugging
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process
{
"version": "0.2.0",
@huihut
huihut / type _conversion_between_PlatformString_and_stdstring.cpp
Last active April 13, 2022 15:47
WinRT(C++/CX) type conversion between Platform::String^ and std::string
#include <string>
std::string Managed_Str_To_Std_Str(Platform::String^ ms)
{
std::wstring w_str(ms->Begin());
return std::string(w_str.begin(), w_str.end());
}
Platform::String^ Std_Str_To_Managed_Str(const std::string & input)
{
@huihut
huihut / MainWindow.xaml.cs
Last active December 28, 2021 01:25
WPF Create Dump
/*
* [MiniDumpWriteDump function](https://docs.microsoft.com/zh-cn/windows/desktop/api/minidumpapiset/nf-minidumpapiset-minidumpwritedump)
* [_MINIDUMP_TYPE Enumeration](https://docs.microsoft.com/zh-cn/windows/desktop/api/minidumpapiset/ne-minidumpapiset-_minidump_type)
* [Programmatically Generating a Dump File](http://blogs.microsoft.co.il/sasha/2008/05/28/programmatically-generating-a-dump-file/)
* [Create your own crash dumps](https://blogs.msdn.microsoft.com/calvin_hsia/2015/08/31/create-your-own-crash-dumps/)
*/
using Microsoft.Win32.SafeHandles;
using System;
using System.Collections.Generic;
@huihut
huihut / CppCallPython.cpp
Created May 16, 2018 10:18
C++ call Python module
#include <iostream>
#include <Python.h>
// C++ call Python module
bool CppCallPython()
{
// Python initialize
Py_Initialize();
if (!Py_IsInitialized())
{
@huihut
huihut / SingletonBase.cs
Created December 15, 2020 09:57
Unity singleton pattern base class
public class SingletonBase<T> where T : new()
{
private static T instance;
public static T GetInstance()
{
if (instance == null)
instance = new T();
return instance;
}
@huihut
huihut / VMwareKey.txt
Created July 19, 2018 07:09
VMware 所有版本永久许可证激活密钥
注:如果是WinXP或32位系统请用 10.0 版本;11.0 版本之后支持Win7或更高版64位系统。
VMware 所有版本永久许可证激活密钥:
VMware Workstation v14 for Windows
FF31K-AHZD1-H8ETZ-8WWEZ-WUUVA
CV7T2-6WY5Q-48EWP-ZXY7X-QGUWD
VMware Workstation v12 for Windows
5A02H-AU243-TZJ49-GTC7K-3C61N
@huihut
huihut / CSharp_type_conversion.cs
Created September 13, 2018 07:54
CSharp type conversion
# Website: http://www.convertdatatypes.com/Language-CSharp.html
# Convert string to bool
string vIn = "true";
bool vOut = Convert.ToBoolean(vIn);
# Convert string to int
string vIn = "0";
int vOut = Convert.ToInt32(vIn);