Skip to content

Instantly share code, notes, and snippets.

@wangye
wangye / msoWord_SplitPages.vbs
Created March 2, 2012 07:22
VBScript/VBS/VBA split single word document to multi-documents by pages
'
' Description: VBScript/VBS/VBA
' split single word document
' to multi-documents by pages
' Author: wangye <pcn88 at hotmail dot com>
' Website: http://wangye.org
' Copyright by author
'
Const PrevPage = 0
Const NextPage = 1
@wangye
wangye / DynamicObject.vbs
Created October 9, 2012 12:03
ASP/VBScript Dynamic Object Generator ASP/VBScript动态创建属性对象的工厂类
'
' ASP/VBScript Dynamic Object Generator
' Author: WangYe
' For more information please visit
' http://wangye.org/
' This code is distributed under the BSD license
'
' UPDATE:
' 2012/11/7
' 1. Add variable key validator.
@wangye
wangye / srvany.vbs
Last active November 28, 2022 04:38
'
' Usage:
' WScript.exe srvany.vbs -name [ServiceName]
' -srvany [SrvAnyFileName]
' -file [ExeFileName]
' -dir [ExeFileDirectory]
' -params [ExeFileParameters]
'
' For more information please visit http://wangye.org
'
@wangye
wangye / GetOpenFileName.vbs
Created February 28, 2012 14:53
Compatible with most Windows platforms, VBScript/VBS open file dialog
'
' Description: VBScript/VBS open file dialog
' Compatible with most Windows platforms
' Author: wangye <pcn88 at hotmail dot com>
' Website: http://wangye.org
'
' dir is the initial directory; if no directory is
' specified "Desktop" is used.
' filter is the file type filter; format "File type description|*.ext"
'
@wangye
wangye / CBase64.vbs
Created March 7, 2012 02:34
VBScript Base64 encode and decode
'
' Description: Base64 encode and decode
' Author: wangye <pcn88 at hotmail dot com>
' Website: http://wangye.org
'
Class CBase64
Private objXmlDom
Private objXmlNode
' GetObjectParam() 这个函数实现参考了开源项目PJBlog
//
// JavaScript Polyfills ( Simplified Chinese )
// https://wangye.org/posts/2022/03/polyfills-in-javascript-for-newer-features.html
//
var polyfill_features = [
"MediaQueryList.prototype.addEventListener",
"String.prototype.startsWith",
"String.prototype.trim",
"Element.prototype.classList",
#!/bin/bash
#
# This script is used to check the IP address of the current machine
# https://wangye.org/posts/2022/02/bash-shell-to-find-dynmatic-public-ip-address.html
#
hosts=("checkip.amazonaws.com" "api.ipify.org" "ifconfig.me/ip" "icanhazip.com" "ipinfo.io/ip" "ipecho.net/plain" "checkipv4.dedyn.io")
CURL=`which curl`
DIG=`which dig`
@wangye
wangye / Base24.cs
Created March 7, 2012 02:31
Base24 encode and decode C#
//
// Description: Base24 encode and decode
// Author: wangye <pcn88 at hotmail dot com>
// Website: http://wangye.org
//
public static class Base24
{
private static string sel = "BCDFGHJKMPQRTVWXY2346789";
public static string Encode(string Text)
'
' File Description : Disable Windows 7/8/8.1 Upgrade to Windows 10
'
' Copyright (c) 2016 WangYe. All rights reserved.
'
' Author: WangYe
' Site: http://wangye.org
' This code is distributed under the BSD license
'
' Usage:

Keybase proof

I hereby claim:

  • I am wangye on github.
  • I am wangye (https://keybase.io/wangye) on keybase.
  • I have a public key ASD2FscOwcvbU8II_TEiCn6CD2xenc7d04M8HncbfwwvWwo

To claim this, I am signing this object: