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
/// <summary> | |
/// 将XML空元素转换成完整格式,比如 <Element /> => <Element></Element> | |
/// </summary> | |
/// <param name="srcFile">待转换XML文件地址</param> | |
/// <param name="destFile">转换后XML保存文件地址</param> | |
public static void TransformEmptyElements(string srcFile, string destFile) | |
{ | |
var srcXML = File.ReadAllText(srcFile); | |
Regex reg = new Regex(@"<\w+\s/>"); |
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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
namespace Portal.Common | |
{ | |
public class Logger | |
{ |
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
//only numberic input | |
jQuery.fn.ForceNumericOnly = function() | |
{ | |
return this.each(function() | |
{ | |
$(this).keydown(function(e) | |
{ | |
var key = e.charCode || e.keyCode || 0; | |
// allow backspace, tab, delete, enter, arrows, numbers and keypad numbers ONLY | |
// home, end, period, and numpad decimal |
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 getUrlVars(key) { | |
if(window.location.href.indexOf('?') < 0){ | |
//no query string | |
return "" | |
} | |
var vars = [], | |
hash; | |
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); | |
for (var i = 0; i < hashes.length; i++) { |
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
package main | |
import ( | |
"fmt" | |
"time" | |
"strconv" | |
) | |
func main(){ | |
for i := 0; i < 2000; i++ { |
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
@echo off | |
SET st2Path=C:\software\SublimeText\sublime_text.exe | |
rem add it for all file types | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text" /t REG_SZ /v "" /d "Open with Sublime Text" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f | |
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f | |
rem add it for folders | |
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text" /t REG_SZ /v "" /d "Open with Sublime Text" /f |
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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Security.Cryptography; | |
using System.IO; | |
namespace ConsoleTester |
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
/* | |
JQuery Plugin for poll message from RESTful API | |
Usage: | |
[HTML] | |
<a href="javascript:void;" id="msgText"></a> | |
[JavaScript] | |
$('#msgText').pollMessage({ | |
'url': '/newmessage/get', |
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 FindProxyForURL(url, host) { | |
var PROXY = "SOCKS5 localhost:1080"; | |
var blocked = ["google.com", | |
"archive.org", | |
"youtube.com", | |
"facebook.com", | |
"blogspot.com", | |
"wordpress.com", | |
"amazonaws.com", |
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
" Vim color file | |
" | |
" Author: Tomas Restrepo <[email protected]> | |
" | |
" Note: Based on the monokai theme for textmate | |
" by Wimer Hazenberg and its darker variant | |
" by Hamish Stuart Macpherson | |
" | |
hi clear |