Skip to content

Instantly share code, notes, and snippets.

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

Frank Huo huoxudong125

💭
I may be slow to respond.
View GitHub Profile
URL="http://stackoverflow.com/"
# store the whole response with the status at the and
HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST $URL)
# extract the body
HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g')
# extract the status
HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
@huoxudong125
huoxudong125 / WPF ComboBox Style.xml
Last active April 20, 2022 13:08 — forked from hansmaad/gist:9187633
WPF Flat Combo Box Style
<!-- Flat ComboBox -->
<SolidColorBrush x:Key="ComboBoxNormalBorderBrush" Color="#e3e9ef" />
<SolidColorBrush x:Key="ComboBoxNormalBackgroundBrush" Color="#fff" />
<SolidColorBrush x:Key="ComboBoxDisabledForegroundBrush" Color="#888" />
<SolidColorBrush x:Key="ComboBoxDisabledBackgroundBrush" Color="#eee" />
<SolidColorBrush x:Key="ComboBoxDisabledBorderBrush" Color="#888" />
<ControlTemplate TargetType="ToggleButton" x:Key="ComboBoxToggleButtonTemplate">
<Grid>
<Grid.ColumnDefinitions>
Java HotSpot(TM) 64-Bit Server VM (25.60-b23) for linux-amd64 JRE (1.8.0_60-b27), built on Aug 4 2015 12:19:40 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)
Memory: 4k page, physical 263727056k(25544080k free), swap 16776188k(16759184k free)
CommandLine flags: -XX:+CMSClassUnloadingEnabled -XX:CMSFullGCsBeforeCompaction=0 -XX:CMSMaxAbortablePrecleanTime=1000 -XX:+CMSParallelRemarkEnabled -XX:CMSScheduleRemarkEdenPenetration=10 -XX:+DisableExplicitGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/export/Logs/gc.hprof -XX:InitialHeapSize=6442450944 -XX:LargePageSizeInBytes=134217728 -XX:MaxHeapSize=6442450944 -XX:MaxNewSize=4294967296 -XX:NewSize=4294967296 -XX:OldPLABSize=16 -XX:+PrintClassHistogram -XX:+PrintGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -XX:+PrintReferenceGC -XX:+PrintTenuringDistribution -XX:SoftRefLRUPolicyMSPerMB=0 -XX:SurvivorRatio=8 -XX:ThreadStackSize=1024 -XX:+TraceClassLoading -XX:+UseCMSCompactAtFullCollection -XX:+UseCompressedClassPointers -XX:+UseCo
@huoxudong125
huoxudong125 / NetworkShareAccesser
Last active February 25, 2021 15:27
Network Share Accesser
/// <summary>
/// Provides access to a network share.
/// </summary>
public class NetworkShareAccesser : IDisposable
{
private string _remoteUncName;
private string _remoteComputerName;
public string RemoteComputerName
{
@huoxudong125
huoxudong125 / Readme.md.md
Last active January 21, 2021 04:42
WPF Get ActualWidth & ActualHeight and assign to ViewModel.

OneWayToSource Binding seems broken in .NET 4.0

#region 版权信息
/*---------------------------------------------------------------------*
// 项目 名称:《Winform分页控件》
// 文 件 名: Pager.cs
// 描 述: 分页控件
// 作 者:kwon yan
*----------------------------------------------------------------------*/
#endregion
using System;
@huoxudong125
huoxudong125 / CharFilter.java
Created July 20, 2018 02:18
Avoid URL has invalid chars
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;
// 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)
@huoxudong125
huoxudong125 / OrderBy Expression.cs
Last active November 21, 2017 06:59 — forked from neoGeneva/gist:1878868
An OrderBy extension method for IQueryable that takes string
public static IQueryable<T> OrderBy<T>(this IQueryable<T> source, string sortExpression)
{
if (source == null)
throw new ArgumentNullException("source", "source is null.");
if (string.IsNullOrEmpty(sortExpression))
throw new ArgumentException("sortExpression is null or empty.", "sortExpression");
var parts = sortExpression.Split(' ');
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