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
/// <summary> | |
/// Convert to DateTimeOffset from Json Date(Unix epoch) | |
/// </summary> | |
/// <param name="jsondate">ex: "/Date(1324707957994+0900)/"</param> | |
/// <returns></returns> | |
public Nullable<DateTimeOffset> ConvertToDateTimeOffsetFromJsonDate(string jsondate) | |
{ | |
if (String.IsNullOrEmpty(jsondate)) return null; | |
var match = Regex.Match(jsondate, @"^\/date\((\d*)([\+\-]?\d*)\)\/+$", RegexOptions.IgnoreCase); |
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 StringExtensions | |
{ | |
public static string Format(this string format, params object[] args) | |
{ | |
return string.Format(format, args); | |
} | |
} |
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 RadixConvert | |
{ | |
private const int Radix = 62; | |
private const string Table = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
public static string Encode(long number) | |
{ | |
const int length = 16; | |
int index = length; |
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
やりたいこと: | |
・object -> IList<object> への変換 | |
・model が null の時には要素数が 0 の IList<object> にする | |
思い付いたコード: | |
初版 | |
var values = new List<string>(((model as IEnumerable) ?? Enumerable.Empty<object>()).Cast<object>().Select(p => p.ToString())); |
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.Configuration; | |
namespace SwissKnife.T4 | |
{ | |
public static class AppSettings | |
{ | |
public static string ClientValidationEnabled | |
{ | |
get { return ConfigurationManager.AppSettings["ClientValidationEnabled"]; } | |
} |
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 DateAttribute : DataTypeAttribute | |
{ | |
public DateAttribute() | |
: base(DataType.Date) | |
{ | |
} | |
public string MonthProperty { get; set; } |
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
<ul id="hatena-bookmark" class="hatena-urllist"></ul> | |
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.10.2.min.js"></script> | |
<script> | |
!function ($, id, url) { | |
var ul = $(id); | |
ul.parent().prev().wrapInner('<a href="http://b.hatena.ne.jp/entrylist?url=' + url + '&sort=count"></a>'); | |
$.getJSON("http://rss2json.azurewebsites.net/hatena/bookmark?callback=?", { url: url }, function (data) { | |
var list = []; |
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
Uninstall-Package Microsoft.AspNet.WebApi | |
Uninstall-Package Microsoft.AspNet.WebApi.WebHost.ja | |
Uninstall-Package Microsoft.AspNet.WebApi.WebHost | |
Uninstall-Package Microsoft.AspNet.WebApi.Core.ja | |
Uninstall-Package Microsoft.AspNet.WebApi.Core | |
Uninstall-Package Microsoft.AspNet.WebApi.Client.ja | |
Uninstall-Package Microsoft.AspNet.WebApi.Client |
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
ActiveAutoscaleProfile: | |
{ | |
"Capacity": { | |
"Minimum": "1", | |
"Maximum": "3", | |
"Default": "1" | |
}, | |
"Rules": [ | |
{ |
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
ActiveAutoscaleProfile: | |
{ | |
"Capacity": { | |
"Minimum": "1", | |
"Maximum": "3", | |
"Default": "1" | |
}, | |
"Rules": [ | |
{ |
OlderNewer