Skip to content

Instantly share code, notes, and snippets.

View kekyo's full-sized avatar
📡
I'm looking for a job

Kouji Matsui kekyo

📡
I'm looking for a job
View GitHub Profile
@vivmishra
vivmishra / dotnet-461-System.Transactions.cs
Created October 23, 2015 18:09
Sample for System.Transactions updates in .NET 4.6.1
using System;
using System.Transactions;
namespace YourNamespaceGoesHere
{
public class NonMSDTCPromoterEnlistment : IPromotableSinglePhaseNotification
{
Guid promoterType;
Guid distributedTxId;
Transaction enlistedTransaction;
public static class ExpressionCombiner
{
public static Expression<Func<T, bool>> OrElse<T>(
params Expression<Func<T, bool>>[] expressions)
{
return OrElse(expressions.AsEnumerable());
}
public static Expression<Func<T, bool>> OrElse<T>(
this IEnumerable<Expression<Func<T, bool>>> expressions)
@mmozeiko
mmozeiko / win32_crt_float.cpp
Last active April 28, 2025 19:10
Visual C/C++ CRT functionality
extern "C"
{
int _fltused;
#ifdef _M_IX86 // following functions are needed only for 32-bit architecture
__declspec(naked) void _ftol2()
{
__asm
{
@pocketberserker
pocketberserker / AsyncInCSharpAndFSharp.ja.rst
Last active October 6, 2022 02:53
Async in C# and F#: Asynchronous gotchas in C# (Japanese translation)

C# と F# の Async: C# の非同期の落とし穴

原文:Async in C# and F#: Asynchronous gotchas in C#
原文著者:Tomas Petricek (@tomaspetricek)
翻訳者:@pocketberserker

2月に、私は毎年恒例のMVPサミット ── Microsoft が MVP のために主催するイベント ── に出席しました。私はボストンとニューヨークを訪問する機会を利用して、二つの F# に関する講演と Channel9 lecture about type providers の収録を行いました。他のすべての活動(しばしばパブで他の F#er を議論に巻き込んだり、朝まで長い睡眠)にもかかわらず、私はいくつかの講演に参加し果せました。

@kiyokura
kiyokura / GetLatestTfsSource.cs
Created September 4, 2012 02:08
TFSのAPIを使って、ソースコードの最新をローカルに取得するサンプ
// TFSのAPIを使って、ソースコードの最新をローカルに取得するサンプル
// 参考:
// MSDN
// http://msdn.microsoft.com/ja-jp/library/microsoft.teamfoundation.versioncontrol.client.workspace%28v=vs.100%29.aspx
// StacK Overflow
// http://stackoverflow.com/questions/8341419/get-latest-using-tfs-api
// http://stackoverflow.com/questions/1827651/how-do-you-get-the-latest-version-of-source-code-using-the-team-foundation-serve
using System;
@theconektd
theconektd / github.css
Created April 30, 2012 02:11
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@darkfall
darkfall / gist:1656050
Created January 22, 2012 07:15
A simple class that converts a image to a icon in c# without losing image color data, unlike System.Drawing.Icon; ico with png data requires Windows Vista or above
class PngIconConverter
{
/* input image with width = height is suggested to get the best result */
/* png support in icon was introduced in Windows Vista */
public static bool Convert(System.IO.Stream input_stream, System.IO.Stream output_stream, int size, bool keep_aspect_ratio = false)
{
System.Drawing.Bitmap input_bit = (System.Drawing.Bitmap)System.Drawing.Bitmap.FromStream(input_stream);
if (input_bit != null)
{
int width, height;