This file contains 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
# setup NPM behinds a HTTP proxy | |
npm config set proxy http://127.0.0.1:1098 | |
npm config set https-proxy http://127.0.0.1:1098 | |
# unset NPM proxy | |
npm config rm proxy | |
npm config rm https-proxy | |
# set NPM to mirror registry | |
npm config set registry https://registry.npm.taobao.org |
This file contains 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
public class TweetHttpClient : ITwitterHttpClient | |
{ | |
public TweetHttpClient() | |
{ | |
_httpClient = new HttpClient | |
{ | |
BaseAddress = new Uri("https://api.twitter.com/") | |
}; | |
} |
This file contains 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
workflow Auto-RestartVM | |
{ | |
Param | |
( | |
[Parameter(Mandatory = $true)] | |
[String] | |
$AzureConnectionName, | |
[Parameter(Mandatory = $true)] | |
[String] |
This file contains 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
public static class Program | |
{ | |
private static readonly string[] Arrays = new[] | |
{ | |
"jerry", | |
"Kate", | |
"Steve", | |
"Mark", | |
"Joe" | |
}; |
This file contains 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
static void SetServiceProperties() | |
{ | |
var requestMethod = "PUT"; | |
var requestBody = string.Format("<StorageServiceProperties><Cors><CorsRule><AllowedOrigins>{0}</AllowedOrigins><AllowedMethods>{1}</AllowedMethods><MaxAgeInSeconds>{2}</MaxAgeInSeconds><ExposedHeaders>{3}</ExposedHeaders><AllowedHeaders>{4}</AllowedHeaders></CorsRule></Cors></StorageServiceProperties>", "http://www.baidu.com", "GET,PUT", 200, "x-ms-meta-*", "x-ms-meta-data*,x-ms-meta-target,x-ms-meta-source"); | |
var storageServiceVersion = "2014-02-14"; | |
var date = DateTime.UtcNow.ToString("R"); | |
var canonicalizedHeaders = string.Format("x-ms-date:{0}\nx-ms-version:{1}", date, storageServiceVersion); | |
var canonicalizedResource = string.Format("/{0}\ncomp:properties\nrestype:service", StorageAccount); | |
var stringToSign = string.Format("{0}\n\n\n{1}\n\ntext/plain; charset=utf-8\n\n\n\n\n\n\n{2}\n{3}", requestMethod, requestBody.Length, canonicalizedHeaders, canonicalizedResource); | |
var authorizationHeader = GetAuthorization |
This file contains 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.Text; | |
namespace ConsoleApplication1 | |
{ | |
using System.Globalization; | |
using System.Net.Http; | |
using System.Security.Cryptography; | |
class Program |
This file contains 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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var context = new TestContext(); | |
context.Parents.Add(new Parent | |
{ | |
Name = "Parent", |
This file contains 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.Collections.ObjectModel; | |
using System.ComponentModel; | |
namespace WpfApplication1.ViewModel | |
{ | |
public class MainWindowViewModel : INotifyPropertyChanged | |
{ | |
public MainWindowViewModel() | |
{ | |
InitSourceCollection(); |
This file contains 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
<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}"/> |
This file contains 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
<!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); |
NewerOlder