Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View takeshik's full-sized avatar

Takeshi KIRIYA takeshik

View GitHub Profile
@takeshik
takeshik / cbo.cs
Last active August 29, 2015 13:55
logging w/ CBO
// license:cc0, free to use.
void Main()
{
var x = new Test();
x.Foo();
x.Bar();
}
[Logging]
void Main()
{
new Foo().Hoge();
}
public class Foo
{
public void Hoge()
{
using (Log.Start(this))
@takeshik
takeshik / f79ed30-HEAD.patch
Last active August 29, 2015 13:59
[PATCH] よくわからないが、こうすると落ちなくなる (酷)
StarryEyes/Hotfixes/ViewModelHelperRx.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/StarryEyes/Hotfixes/ViewModelHelperRx.cs b/StarryEyes/Hotfixes/ViewModelHelperRx.cs
index 811f4ed..2efd9c6 100644
--- a/StarryEyes/Hotfixes/ViewModelHelperRx.cs
+++ b/StarryEyes/Hotfixes/ViewModelHelperRx.cs
@@ -77,7 +77,7 @@ namespace StarryEyes
switch (e.Action)
{
From b6f08957c1605b441385e6b671f9fdd7b6df9cf4 Mon Sep 17 00:00:00 2001
From: Takeshi KIRIYA <takeshik@xspect.org>
Date: Mon, 14 Jul 2014 09:24:07 +0900
Subject: [PATCH] improve connection
---
StarryEyes.Casket/Cruds/ListUserCrud.cs | 6 +-
StarryEyes.Casket/Cruds/ManagementCrud.cs | 6 +-
StarryEyes.Casket/Cruds/Scaffolding/CrudBase.cs | 74 ++-----------------------
StarryEyes.Casket/Cruds/UserCrud.cs | 2 +-
@takeshik
takeshik / DynamicJson.patch
Created November 26, 2014 17:10
Fix deserialized property name if the key contains (perhaps) non-ASCII, or XML-element-invalid chars
--- DynamicJson.cs
+++ DynamicJson.fixed.cs
@@ -322,15 +322,17 @@
// Deserialize or foreach(IEnumerable)
public override bool TryConvert(ConvertBinder binder, out object result)
{
if (binder.Type == typeof(IEnumerable) || binder.Type == typeof(object[]))
{
var ie = (IsArray)
? xml.Elements().Select(x => ToValue(x))
private int _refreshInterval;
public int RefreshInterval
{
get { return _refreshInterval; }
set
{
if (_refreshInterval > 0 && _refreshInterval < 30) _refreshInterval = 30;
_refreshInterval = value;
}
using System;
using System.Linq;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using XSpect.MetaTweet;
using XSpect.MetaTweet.Modules;
using XSpect.MetaTweet.Objects;
internal class ClientTest
@takeshik
takeshik / Tween.sounddir.patch
Created February 17, 2010 06:14
Patch for Tween to separate nofification sounds' directory
Index: FilterDialog.vb
===================================================================
--- FilterDialog.vb (リビジョン 101)
+++ FilterDialog.vb (作業コピー)
@@ -627,6 +627,9 @@
ComboSound.Items.Clear()
ComboSound.Items.Add("")
Dim oDir As IO.DirectoryInfo = New IO.DirectoryInfo(My.Application.Info.DirectoryPath)
+ If IO.Directory.Exists(IO.Path.Combine(My.Application.Info.DirectoryPath, "Sounds")) Then
+ oDir = oDir.GetDirectories("Sounds")(0)
// Output of Twitter Post in MetaTweet (XSpect.MetaTweet.Objects.Activity)
// by DataContractJsonSerializer, formatted by hand:
{
"__type": "Activity:#XSpect.MetaTweet.Objects",
"Storage": null,
"Account": {
"__type": "Account:#XSpect.MetaTweet.Objects",
"Storage": null,
"AccountId": "6a2e87a4-ec57-4f9c-96b2-e30197ab3360",
"Realm": "com.twitter"
return Encoding.UTF8.GetString(new MemoryStream()
.Let(_ => _.Dispose(
s => new DataContractJsonSerializer(typeof(StorageObject))
.WriteObject(s, source.ToList())
))
.ToArray()
);