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 / yii-db-connection-string
Created February 10, 2012 09:18
Yii 数据库连接
SQLite: sqlite:/path/to/dbfile
MySQL: mysql:host=localhost;dbname=testdb
PostgreSQL: pgsql:host=localhost;port=5432;dbname=testdb
SQL Server: mssql:host=localhost;dbname=testdb
Oracle: oci:dbname=//localhost:1521/testdb
'emulatePrepare' => true,
'username' => 'username',
'password' => 'password',
'charset' => 'utf8',
@hiscaler
hiscaler / gzip
Created February 11, 2012 01:00
Yii enable gzip
<?php
class GzipBehavior extends CBehavior
{
public function events ()
{
return array ( 'onBeginRequest' => 'beginRequest','onEndRequest' => 'endRequest' );
}
@hiscaler
hiscaler / css common names.md
Created March 9, 2012 06:55
CSS 常用命名

CSS class 命名

  • 页头: header
  • 登录条: login-bar
  • 标志: logo
  • 侧栏: side-bar
  • 广告: banner
  • 导航: nav
  • 子导航: sub-nav
  • 菜单: menu
@hiscaler
hiscaler / asp-web-services
Created May 10, 2012 06:55
ASP 操作 Web Services
dim objDoc, objSOAPClient
set objDoc = Server.CreateObject("Msxml2.DomDocument.4.0")
set objSOAPClient = Server.CreateObject("MSSOAP.SoapClient30")
sPath = "http://192.168.0.1/services/webService?wsdl"
objSOAPClient.ClientProperty("ServerHTTPRequest") = true
objSOAPClient.MSSoapInit(sPath)
if err.number <> 0 then
Response.Write("<script type=""text/javascript"">alert('Web Services 调用失败。');location.href='?';</script>")
else
@hiscaler
hiscaler / ArrayHelper.asp
Created May 31, 2012 06:56
ASP Array Helper
<%
' Array Helper
Class Class_ArrayHelper
'**************************************************
'函数名:isNoneArray
'作 用:检测是空数组
'**************************************************
Public Function isNoneArray(Byval Arr)
If NOT IsArray(Arr) Then
isNoneArray = True
@hiscaler
hiscaler / ValidatorHelper.asp
Created May 31, 2012 06:58
ASP ValidatorHelper
<%
'#####################
' 数据验证
' author: hiscaler
' create date: 2012-5-29
'#####################
Class Class_ValidatorHelper
Public Function isRequired(ByVal value)
If (UtilHelper.checkNull(value)) Then
@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
@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 / 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 / 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.★☆ ☆★