Skip to content

Instantly share code, notes, and snippets.

View hiscaler's full-sized avatar
💭
I may be slow to respond.

hiscaler hiscaler

💭
I may be slow to respond.
View GitHub Profile
@hiscaler
hiscaler / base64.java
Created July 13, 2013 02:05
Base64 in Java
public final class Base64 {
static private final int BASELENGTH = 255;
static private final int LOOKUPLENGTH = 64;
static private final int TWENTYFOURBITGROUP = 24;
static private final int EIGHTBIT = 8;
static private final int SIXTEENBIT = 16;
static private final int FOURBYTE = 4;
static private final int SIGN = -128;
static private final char PAD = '=';
@hiscaler
hiscaler / gist:5333358
Created April 8, 2013 00:43
Query table columns schema for SQLServer(Test in 2008)
SELECT
( CASE WHEN a.colorder = 1 THEN d.name
ELSE ''
END ) N'表名',
a.colorder N'字段序号',
a.name N'字段名',
( CASE WHEN COLUMNPROPERTY(a.id, a.name, 'IsIdentity') = 1 THEN '√'
ELSE ''
END ) N'标识',
( CASE WHEN ( SELECT
@hiscaler
hiscaler / StringHelper.asp
Created November 29, 2012 03:10
ASP String operation
<%
' String helper
Class Class_StringHelper
'**************************************************
'函数名:strLength
'作 用:检测字符串长度
'**************************************************
Function strLength(Str)
dim i, Temp_str, Test_Str, size
@hiscaler
hiscaler / RSA.asp
Created November 29, 2012 03:09
ASP RSA 加解密
<%
' 在ASP中实现加密与解密,加密方法:根据 RSA
Class clsRSA
Public PrivateKey
Public PublicKey
Public Modulus
Public Function Crypt(pLngMessage, pLngKey)
On Error Resume Next
@hiscaler
hiscaler / Dbhelper.asp
Last active October 13, 2015 08:18
ASP Database Helper
<%
' 数据库操作助手文件
Class Class_DbHelper
' 获取数据库版本
Public Function version()
Dim versionString, v:v = Null
versionString = Conn.Execute("SELECT SERVERPROPERTY('productversion')")(0) ' 2000+
@hiscaler
hiscaler / Base64.asp
Created November 29, 2012 03:06
ASP Base64
<%
' Base64 加解密函数
' .NET 实现
' public string encrypt(string str)
' {
' byte[] encbuff = System.Text.Encoding.UTF8.GetBytes(str);
'
' return Convert.ToBase64String(encbuff);
' }
@hiscaler
hiscaler / win7-disk-cleaner.bat
Created August 24, 2012 02:00
Win7 Disk Cleaner
@echo off
color 0a
title 清理win7系统垃圾---
echo ★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
echo ★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
echo.★☆ ☆★
echo.★☆ ☆★
echo.★☆ ☆★
echo ★☆ 正在清除系统垃圾文件,请稍等..... ☆★
echo.★☆ ☆★
@hiscaler
hiscaler / gist:3422857
Created August 22, 2012 06:20
mercurial ini setting
[auth]
bb.prefix = http://bitbucket.org
bb.username = username
bb.password = password
bbs.prefix = https://bitbucket.org
bbs.username = username
bbs.password = password
[ui]
@hiscaler
hiscaler / uuid
Created August 1, 2012 03:03
php uuid
function uuid() {
$node = (isset($_SERVER['SERVER_ADDR'])) ? $_SERVER['SERVER_ADDR'] : null;
$pid = null;
if (strpos($node, ':') !== false) {
if (substr_count($node, '::')) {
$node = str_replace('::', str_repeat(':0000', 8 - substr_count($node, ':')) . ':', $node);
}
$node = explode(':', $node);
$ipv6 = '';
@hiscaler
hiscaler / vbs-replace-file-contents.vbs
Created July 12, 2012 03:28
VBScript Replace file contents
Dim filePath, fileContents, dFileContents
filePath = "C:\"
' 查找所有 .lst 扩展名文件
Dim fs, f, array1, f1
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder("C:\")
Set fc = f.Files
For Each f1 in fc