Skip to content

Instantly share code, notes, and snippets.

View taross-f's full-sized avatar

Taro Furuya taross-f

View GitHub Profile
@taross-f
taross-f / get-only_property.snippet
Last active May 23, 2016 04:05
C#6.0 get-only property snippet
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>propgo</Title>
<Shortcut>propgo</Shortcut>
<Description>'get' アクセサーを使用する、get-onlyプロパティ用のコード スニペット
言語バージョン: C# 6 以降</Description>
<Author>taro.furuya@gmail.com</Author>
<SnippetTypes>
@taross-f
taross-f / FlagEnumEx.cs
Last active August 19, 2016 10:55
Enum with FlagAttribute extension
void Main()
{
var f = BitHoge.a;
f = f.WithFlag(BitHoge.b);
f.Dump(); // a, b
f.HasFlag(BitHoge.a).Dump(); // true
f.HasFlag(BitHoge.c).Dump(); // false
f = f.WithoutFlag(BitHoge.a);
f.Dump(); // b
f.HasFlag(BitHoge.a).Dump(); // false
@taross-f
taross-f / addbuttons.js
Created October 31, 2016 05:37
add Re: buttons and quote buttons to hipchat
$(function(){
console.log("loding...");
setInterval(function() {
var buttons = $(".msg-line > .hc-dropdown");
buttons.each(function(_, element) {
var b = $(element);
if (b.children('.btn-addon').length) return;
// add quote button
@taross-f
taross-f / get_parent_dir.ps1
Last active November 16, 2016 09:49
get parent dir
$parentPath = (Split-Path ( & { $myInvocation.ScriptName } ) -parent)
@taross-f
taross-f / chatworkBot.js
Last active January 5, 2017 10:13
chatwork_bot on GAS
function humidifier() {
if (_todayIsHoliday()) return;
var members = client.get("/rooms/" + roomId + "/members");
var target = _gacha(members);
while (isInvalid(target.account_id)) {
target = _gacha(members);
}
client.sendMessage({room_id: roomId, body: "[To:" + target.account_id + "] " + target.name + "さん\n" +
target.name + "さん(clap)"});
<Query Kind="Program">
<Reference>&lt;RuntimeDirectory&gt;\System.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Net.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Net.Http.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Web.dll</Reference>
<NuGetReference>Microsoft.Net.Http</NuGetReference>
<NuGetReference>Newtonsoft.Json</NuGetReference>
<NuGetReference>Sendgrid</NuGetReference>
<Namespace>Newtonsoft.Json</Namespace>
<Namespace>Newtonsoft.Json.Bson</Namespace>
<Query Kind="Program">
<Reference>&lt;RuntimeDirectory&gt;\System.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Net.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Net.Http.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Web.dll</Reference>
<NuGetReference>Microsoft.Net.Http</NuGetReference>
<NuGetReference>Newtonsoft.Json</NuGetReference>
<NuGetReference>Sendgrid</NuGetReference>
<Namespace>Newtonsoft.Json</Namespace>
<Namespace>Newtonsoft.Json.Bson</Namespace>
@taross-f
taross-f / stableSort.cs
Created January 6, 2017 10:40
stable_sort
<Query Kind="Program">
<Reference>&lt;RuntimeDirectory&gt;\System.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Net.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Net.Http.dll</Reference>
<NuGetReference>Microsoft.Net.Http</NuGetReference>
<NuGetReference>Newtonsoft.Json</NuGetReference>
<NuGetReference>Sendgrid</NuGetReference>
<Namespace>Newtonsoft.Json</Namespace>
<Namespace>Newtonsoft.Json.Bson</Namespace>
<Namespace>Newtonsoft.Json.Converters</Namespace>
<Query Kind="Program">
<Reference>&lt;RuntimeDirectory&gt;\System.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Net.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Net.Http.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Web.dll</Reference>
<NuGetReference>Microsoft.Net.Http</NuGetReference>
<NuGetReference>Newtonsoft.Json</NuGetReference>
<NuGetReference>Sendgrid</NuGetReference>
<Namespace>Newtonsoft.Json</Namespace>
<Namespace>Newtonsoft.Json.Bson</Namespace>
<Query Kind="Program">
<Reference>&lt;RuntimeDirectory&gt;\System.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Net.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Net.Http.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Web.dll</Reference>
<NuGetReference>Microsoft.Net.Http</NuGetReference>
<NuGetReference>Newtonsoft.Json</NuGetReference>
<NuGetReference>Sendgrid</NuGetReference>
<Namespace>Newtonsoft.Json</Namespace>
<Namespace>Newtonsoft.Json.Bson</Namespace>