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.Collections.Generic; | |
using System.Threading.Tasks; | |
namespace ConsoleApp1 | |
{ | |
class Program | |
{ | |
static async Task Main(string[] 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
using System; | |
namespace IMC.Util | |
{ | |
public static class ByteArrayExtensions | |
{ | |
/// <summary> | |
/// 16 進数の文字列に変換します | |
/// </summary> | |
public static string ToHexString(this byte[] source, bool upperCase = false) |
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
exports.handler = (event, context, callback) => { | |
const response = { | |
status: '302', | |
statusDescription: 'Found', | |
headers: { | |
location: [{ | |
key: 'Location', | |
value: '{url}', | |
}], | |
}, |
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 MyClass | |
{ | |
public int Id { get; set; } | |
public double Value { 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
namespace ObjectToCsv | |
{ | |
internal class Program | |
{ | |
public static void Main(string[] 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 static class LinqExtensions | |
{ | |
// KeySelector を指定して distinct | |
public static IEnumerable<T> Distinct<T, TKey>(this IEnumerable<T> source, Func<T, TKey> keySelector) | |
{ | |
IEnumerable<T> Enumerate() | |
{ | |
var set = new HashSet<TKey>(); | |
foreach (var elem in source) | |
{ |
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 int Add(int x, int y) | |
{ | |
return x + y; | |
} |
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 NameValueCollectionExtensions | |
{ | |
public static IEnumerable<KeyValuePair<string, IEnumerable<string>>> AsEnumerable(this NameValueCollection that) | |
{ | |
return that.AllKeys | |
.Select(key => new KeyValuePair<string, IEnumerable<string>>(key, that.GetValues(key))); | |
} | |
public static IEnumerable<KeyValuePair<string, string>> AsFlattenEnumerable(this NameValueCollection that) | |
{ |
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
namespace BuilderSample | |
{ | |
/// <summary> | |
/// immutable な Person class | |
/// </summary> | |
public class Person | |
{ | |
public string Name { get; } | |
public int Age { get; } |
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
" http://qiita.com/mfujimori/items/9fd41bcd8d1ce9170301 | |
" setting | |
"文字コードをUFT-8に設定 | |
set fenc=utf-8 | |
" バックアップファイルを作らない | |
set nobackup | |
" スワップファイルを作らない | |
set noswapfile | |
" 編集中のファイルが変更されたら自動で読み直す | |
set autoread |