Skip to content

Instantly share code, notes, and snippets.

View JerryBian's full-sized avatar
🀄
Focusing

Jerry Bian JerryBian

🀄
Focusing
View GitHub Profile
@JerryBian
JerryBian / gist:3205340
Created July 30, 2012 06:32
C# code,Regular Expression,obatin special url from html string
//gdfgfdg<a href="/excel/dsfsf-).xls">/excel/dsfsf-).xls</a>dsfdsfdsf....
internal class Program
{
public static string source = @"C:\Users\JBian\Documents\visual studio 2010\Projects\ConsoleApplication23\ConsoleApplication23\Files\source.txt";
public static string result = @"C:\Users\JBian\Documents\visual studio 2010\Projects\ConsoleApplication23\ConsoleApplication23\Files\result.txt";
private static void Main(string[] args)
{
StreamReader sd = new StreamReader(source);
string pattern1 = "(<a href=\"\\/excel\\/[\\w|\\-|\\(|\\)]+\\.(xls|html)\">[\\w|\\-|\\(|\\)]+\\.(xls|html)</a>)";
@JerryBian
JerryBian / gist:3214156
Created July 31, 2012 06:00
C# code,Insertion Sort
internal class Program
{
private static void Main(string[] args)
{
int[] num = { 69, 56, 77, 44, 8, 0, 111, 566 };
for (int i = 1; i < num.Length; i++)
{
int key = num[i];
int j = i - 1;
while (j >= 0 && num[j] > key)
@JerryBian
JerryBian / SyncVPSAndGithub
Created December 18, 2012 07:04
shell script for blog hosting on VPS, powered by Jekyll and GitHub. This script can do the following: 1).keeps sync with github about my blog source and data. 2).uses jekyll to generate the HTML of my blog. 3).sends a email if Jekyll exists with an error.
#!/bin/bash
#function: send a email when error occurs
send_email_and_exit(){
recipient=$1
msg=$2
#send email
/bin/mail -s "blog generation failure" "${recipient}" << EOF
${msg}
@JerryBian
JerryBian / gist:4368166
Created December 24, 2012 07:05
a sample for WF.
internal class Program
{
private static void Main(string[] args)
{
WorkflowInvoker.Invoke(CreateWorkflow());
Console.ReadKey();
}
private static Activity CreateWorkflow()
@JerryBian
JerryBian / RssSchema.xml
Last active December 11, 2015 22:39
RSS
<?xml version="1.0" encoding="utf-8"?>
<channel>
<title></title>
<link></link>
<description></description>
<language></language>
<copyright></copyright>
<managingEditor></managingEditor>
<webMaster></webMaster>
<pubDate></pubDate>
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title></title>
<link href="" rel="self"/>
<link href=""/>
<updated></updated>
<id></id>
<author>
<name></name>
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc></loc>
<lastmod></lastmod>
<changefreq></changefreq>
<priority></priority>
</url>
</urlset>
@JerryBian
JerryBian / temp
Created April 26, 2013 09:53
temp
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Welcome...</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="../../Content/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="../../Content/bootstrap-responsive.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<script language="JavaScript">
var sWeek = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
var dNow = new Date();
var CalendarData = new Array(100);
var madd = new Array(12);
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<StackPanel>
<ComboBox x:Name="ComboBox1" ItemsSource="{Binding SourceCollection1}" DisplayMemberPath="Name" SelectedItem="{Binding Selected1}"/>
<ComboBox x:Name="ComboBox2" ItemsSource="{Binding SourceCollection2}" DisplayMemberPath="Name" SelectedItem="{Binding Selected2}"/>
<ComboBox x:Name="ComboBox3" ItemsSource="{Binding SourceCollection3}" DisplayMemberPath="Name" SelectedItem="{Binding Selected3}"/>
<ComboBox x:Name="ComboBox4" ItemsSource="{Binding SourceCollection4}" DisplayMemberPath="Name" SelectedItem="{Binding Selected4}"/>