Skip to content

Instantly share code, notes, and snippets.

View ledsun's full-sized avatar

shigeru.nakajima ledsun

View GitHub Profile
@ledsun
ledsun / HogeHogeSession.java
Created March 5, 2012 13:25
servletのセッション操作をラッピングするクラス
public class HogeHogeSession {
public static SessionWrapper<int> searchCondition = new SessionWrapper<int>(
"HogeHoge");
}
@ledsun
ledsun / PageBase.cs
Created March 8, 2012 01:40
ログ出力を追加したASP.NETページ基底クラス。NLog使ってます。
public abstract class PageBase : System.Web.UI.Page
{
/// <summary>
/// イベント呼び出しのログ出力用メソッドです
/// </summary>
/// <param name="PageName">ページ名(日本語)</param>
/// <param name="EventName">イベント名(日本語)</param>
/// <param name="memo">その他メモ(あれば)</param>
/// <param name="queryNames">クエリパラメータ名(あれば)</param>
protected void EventTraceLog(string PageName, string EventName, string memo = "", string[] queryNames = null)
@ledsun
ledsun / DTOBase.cs
Created March 8, 2012 02:50
リフレクションを使ったToStringの実装例
public class DTOBase
{
public override string ToString()
{
var values = new List<string>();
foreach (var field in GetType().GetFields())
{
values.Add(string.Format("{0}:{1}", field.Name, field.GetValue(this)));
}
@ledsun
ledsun / gist:2042922
Created March 15, 2012 08:25
C#の正規表現チートシート
//全角カナ32文字
Regex.IsMatch(val, "^[ァ-ー]{0,32}$");
//郵便番号
Regex.IsMatch(val, "^[0-9]{3}-[0-9]{4}$");
@ledsun
ledsun / HelloWorld.ps
Created March 25, 2012 01:57
HelloWorld.ps
Write-Host 'Hello World!'
@ledsun
ledsun / gist:2196199
Created March 25, 2012 14:37
Download Chiraw, Scarecrows And Lullabies mp3 music
Download Chiraw, Scarecrows And Lullabies mp3 music free. unlimited access, high speed downloads
Download Chiraw, Scarecrows And Lullabies mp3 music
Highspeed download torrent Download Chiraw, Scarecrows And Lullabies mp3 music
Check our website for torrent links!
Download Chiraw, Scarecrows And Lullabies mp3 music
@ledsun
ledsun / 僕が考えた最強の「アジャイルソフトウェアの12の原則」訳.md
Created March 25, 2012 15:28
僕が考えた最強の「アジャイルソフトウェアの12の原則」訳

Agile Samurai Dojo Gatheringにて角谷さんの「アジャイルソフトウェアの12の原則」の訳に対する熱い思いを受けた。

俺もやる!君もやれ、Fork me!!!


Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.

顧客満足を最優先し、価値のあるソフトウェアを早く継続的に提供します。 
@ledsun
ledsun / LimitedString.cs
Created April 6, 2012 02:55
長さ制限を持つ文字列クラス
public class LimitedString : IEnumerable<char>
{
protected string Val { get; set; }
public LimitedString(string value, int min = 0, int max = int.MaxValue)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
@ledsun
ledsun / gist:2317249
Created April 6, 2012 05:26
長さ制限を持つ文字列クラスその2
[TestClass]
public class SuperLimitedStringTest
{
[TestMethod]
public void hogehgoe()
{
new SuperLimitedString("a");
new SuperLimitedString("ab", min: 2);
new SuperLimitedString("ab", max: 2);
new SuperLimitedString("ab", min: 2, max:2);
@ledsun
ledsun / TemplateDataClass.cs
Created April 18, 2012 06:14
C#のデータクラステンプレ
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Web;
namespace Hoge
{