Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Frank Huo huoxudong125

💭
I may be slow to respond.
  • China
View GitHub Profile
View Pager.cs
#region 版权信息
/*---------------------------------------------------------------------*
// 项目 名称:《Winform分页控件》
// 文 件 名: Pager.cs
// 描 述: 分页控件
// 作 者:kwon yan
*----------------------------------------------------------------------*/
#endregion
using System;
@huoxudong125
huoxudong125 / CharFilter.java
Created Jul 20, 2018
Avoid URL has invalid chars
View CharFilter.java
package com.jst.sys.filter;
import java.io.IOException;
import java.util.Enumeration;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
View debugger pause beforeunload
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
View Send-File.ps1
Function Send-File {
<#
.SYNOPSIS
Sends a file to a remote session.
.EXAMPLE
PS >$session = New-PsSession leeholmes1c23
PS >Send-File c:\temp\test.exe c:\temp\test.exe $session
.NOTES
@huoxudong125
huoxudong125 / README.md
Created Sep 18, 2017 — forked from magnetikonline/README.md
PowerShell example to copy local files recursively to target server share with orphan cleanup.
View README.md

PowerShell copy local files recursively to target server

A PowerShell script which provides the following:

  • Mount remote/target server share with given username/password credentials.
  • Copy all $SourcePath files to target share ($TargetServer / $TargetShare) recursively.
  • Finally, clean up all orphaned directories/files from target share.

Usage example

./remotecopy.ps1 `
	-SourcePath "." `
View Get-CredentialFromWindowsCredentialManager.ps1
<#
.SYNOPSIS
Gets a PowerShell Credential (PSCredential) from the Windows Credential Manager
.DESCRIPTION
Adapted from: http://stackoverflow.com/questions/7162604/get-cached-credentials-in-powershell-from-windows-7-credential-manager
.PARAMETER TargetName
The name of the target login informations in the Windows Credential Manager
View Get-MACVendor.ps1
<#
.SYNOPSIS
Find MAC Address Vendors
.DESCRIPTION
Lookup Vendor of MAC Address regsitered on IEEE.org (Institute of Electrical and Electronics Engineers) database
.PARAMETER MACAddress
MAC address to lookup
View alibaba maven mirror
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
View DeployWebAPP2IIS.ps1
function ZipMe {
Param([string]$path)
if (-not $path.EndsWith('.zip')) {$path += '.zip'}
if (-not (test-path $path)) {
set-content $path ("PK" + [char]5 + [char]6 + ("$([char]0)" * 18))
}
$ZipFile = (new-object -com shell.application).NameSpace($path)
#$input | foreach {$zipfile.CopyHere($_.fullname, 20)}
@huoxudong125
huoxudong125 / pullToLoadMore.js
Created Jul 27, 2017
上拉加载更多产品,引入Throttle避免部分浏览器触发多次 滚动事件
View pullToLoadMore.js
//滚动事件
$(".contain").scroll(function () {
if ($(this).scrollTop() + $(this).innerHeight() > $(this)[0].scrollHeight - 300) {
if (new Date().getTime() - mySpace.now > 2000) {
mySpace.now = new Date().getTime();
setTimeout(function () {
console.log(mySpace.currentTabId + " scroll to bottom");
mySpace.getDataByTabId();
// alert("scroll to bottom"+ mySpace.now);
You can’t perform that action at this time.