Skip to content

Instantly share code, notes, and snippets.

View bleis-tift's full-sized avatar

bleis-tift bleis-tift

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
#pragma warning disable 0414
namespace Enumに柔軟な拡張を追加する試み
{
nnoremap <Space>gn :<C-u>w<CR>:Git now<CR>
nnoremap <Space>gN :<C-u>w<CR>:Git now --all<CR>
// Microsoft.CSharpを参照に追加すること
open System.Reflection
open System.Runtime.CompilerServices
open Microsoft.FSharp.Reflection
open Microsoft.CSharp.RuntimeBinder
let convert (inp:obj) : 'res =
inp |> unbox
Option Explicit
Private xSource As Variant
Private xLbRow As Long
Private xUbRow As Long
Private xLbCol As Long
Private xUbCol As Long
Private xIndexes As Variant
@bleis-tift
bleis-tift / git-now
Created October 29, 2011 13:05 — forked from mzp/git-now
git-now
#!/bin/sh
PREFIX="from now"
MESSAGE="[${PREFIX}] `date +\"%Y/%m/%d %T\"`"
get_amend() {
if [ -z `git log --pretty=oneline -1 | cut -d " " -f 2- | grep "^\[${PREFIX}]"` ]
then
return 1
fi
@bleis-tift
bleis-tift / gist:2969500
Created June 22, 2012 00:32 — forked from forki/gist:2964839
Static duck typing (F#2.0)
let inline speak (a: ^a) =
let x = (^a : (member Name: string) (a))
printfn "I'm %s" x
let y = (^a : (member talk: unit -> string) (a))
printfn "I say %s" y
//type Duck =
// { Name : string } // Name is not property in F# 2.0
//
// member x.talk() = "quackity quack"
@bleis-tift
bleis-tift / TaskMonad.cs
Created November 20, 2012 07:18 — forked from yoshihiro503/TaskMonad.cs
C# で非同期タスク モナド書いてみた。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Proofcafe
{
public static class TaskMonad
interface A {
hoge(str:string): string;
}
interface B {
hoge(str:string): string;
}
class AImpl implements A {
hoge(str) {
using System;
namespace LangExt.Playground
{
public sealed class LazyVal<T>
{
T value;
bool hasValue = false;
readonly Func<T> f;
@bleis-tift
bleis-tift / 0.LazyVal.cs
Last active December 17, 2015 07:28 — forked from anonymous/gist:5572563
System.Lazyの合成できる版的な
using System;
using System.ComponentModel;
namespace LangExt.Playground
{
public sealed class LazyVal<T>
{
readonly Func<T> f;
bool hasValue = false;
T value;