Skip to content

Instantly share code, notes, and snippets.

View gist:2363853
Configuration smtpServerConfiguration = new Configuration();
smtpServerConfiguration.SetPort(25);
smtpServerConfiguration.SetServer("smtp.8bitclockwork.com");
smtpServerConfiguration.SetTimeout(60);
View gist:2363890
Configuration smtpServerConfiguration = new Configuration();
smtpServerConfiguration
.SetPort(3)
.SetServer("bob")
.SetTimeout(333);
@pparadis
pparadis / gist:2363900
Created Apr 12, 2012
Configuration class
View gist:2363900
class Configuration
{
private String _server { get; set; }
private int _timeout { get; set; }
private int _port { get; set; }
public Configuration SetPort(int port)
{
_port = port;
return this;
View gist:2380461
var result = session
.Query<Wine>()
.Where(p => p.Id == wineId))
.First()
View gist:2582109
var x = 10;
var y = "2";
var result = x * y;
View HTTP Request
HTTP/1.0 304 Not Modified
Date: Wed, 09 May 2012 00:26:52 GMT
Content-Type: text/html; charset=UTF-8
Last-Modified: Tue, 08 May 2012 23:51:26 GMT
Age: 113
X-Cache: HIT from cp1015.eqiad.wmnet
X-Cache-Lookup: HIT from cp1015.eqiad.wmnet:3128
X-Cache: MISS from cp1011.eqiad.wmnet
X-Cache-Lookup: MISS from cp1011.eqiad.wmnet:80
Connection: keep-alive
View gist:2831427
dynamic expando = new ExpandoObject();
expando.Title = "Ceci est un titre";
expando.Nom = "Paradis";
expando.Prenom = "Pascal";
foreach (var e in (IDictionary<String, Object>) expando)
{
Console.WriteLine(e.Value);
}
View gist:2831441
dynamic expando = new ExpandoObject();
expando.Title = "Ceci est un titre";
expando.Nom = "Paradis";
expando.Prenom = "Pascal";
View gist:2885531
dynamic urlDictionnary = new UrlDictionnary();
urlDictionnary.HomePage = "http://www.parad.is";
urlDictionnary.About = "http://frenchcoding.wordpress.com/about/";
urlDictionnary.Blog = "http://frenchcoding.wordpress.com";
View gist:2921048
public class UrlDictionnary : DynamicObject
{
Dictionary<string, string> dictionary = new Dictionary<string, string>();
public int Count
{
get
{
return dictionary.Count;
}