This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.web.config & Settings.cs 化 | |
2.attribute產生log & web log | |
3.javascript minify nonchache & json parse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//how to use it ? | |
//1. You need jQuery | |
//2. finish the code about GetData GetTemplate GenSomething | |
//3. Call the Run() like the following | |
var obj = new myObject(); | |
obj.Run(); | |
// | |
function myObject() { | |
var template, | |
data = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function showInfo(Obj) | |
{ | |
for (var k in Obj) { | |
if (Obj.hasOwnProperty(k)) { | |
console.log("Obj." + k + ":" + Obj[k]); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function stopEventBubble(e) { | |
if (e && e.stopPropagation) { | |
e.stopPropagation(); | |
} | |
else {//why always IE | |
window.event.cancelBubble = true; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE FUNCTION [dbo].[UF_SliptToTable] | |
( | |
@psCSString VARCHAR(8000) | |
) | |
RETURNS @otTemp TABLE(sID VARCHAR(100)) | |
AS | |
BEGIN | |
DECLARE @sTemp VARCHAR(100) | |
WHILE LEN(@psCSString) > 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//namespace pattern | |
var MYAPP = MYAPP || {}; | |
MYAPP.namespace = function(ns_string){ | |
var parts = ns_string.split('.'), | |
parent = MYAPP, | |
i; | |
if(parts[0]==="MYAPP"){ | |
parts = parts.slice(1); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @Date DATETIME | |
Set @Date = GetDate() | |
DECLARE @Start DATETIME,@End DATETIME | |
DECLARE @Index INT | |
SET @Start = DATEADD(MONTH,DATEDIFF(MONTH,0,@Date),0) | |
SET @End = DATEADD(MONTH,1,@Start) | |
SET @Index = DATEDIFF(DAY,-1,@Start)%7 - 1; | |
SET @Start = DATEADD(mm,DATEDIFF(mm,0,@Date),0) | |
SET @End = DATEADD(mm,1,@Start) - 1 | |
SET @Index= DATEDIFF(day,0,@Start)%7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This function creates a new anchor element and uses location | |
// properties (inherent) to get the desired URL data. Some String | |
// operations are used (to normalize results across browsers). | |
function parseURL(url) { | |
var a = document.createElement('a'); | |
a.href = url; | |
return { | |
source: url, | |
protocol: a.protocol.replace(':',''), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
////example | |
////http://goo.gl/FOMIgW | |
//template = '<li{is Selected}>{isChecked}<a href="/learn/{rootId}/topic/{courseId}">{indexStr} {courseName}</a></li>'; | |
//var data = { | |
// isSelected: node.CourseId == Info.PageData.cId * 1 ? ' class="sel"' : "", | |
// isChecked: renderCheckedBox(node.CourseNodeType, node.Percentage, node.CourseId), | |
// indexStr: node.LevelIndex.join("-"), | |
// courseName: node.Name, | |
// rootId: Info.PageData.rId, | |
// courseId: node.CourseId |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//隨機GUID | |
function RandomGUID(){ | |
return 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); | |
return v.toString(16); | |
}); | |
} | |
//隨機整數 | |
function RandomNum(Min,Max){ |