Skip to content

Instantly share code, notes, and snippets.

View madd0's full-sized avatar

Mauricio Díaz Orlich madd0

View GitHub Profile
// --------------------------------
// <copyright file="FacebookOAuthClient.cs" company="Thuzi LLC (www.thuzi.com)">
// Microsoft Public License (Ms-PL)
// </copyright>
// <author>Nathan Totten (ntotten.com), Jim Zimmerman (jimzimmerman.com) and Prabir Shrestha (prabir.me)</author>
// <license>Released under the terms of the Microsoft Public License (Ms-PL)</license>
// <website>http://facebooksdk.codeplex.com</website>
// ---------------------------------
namespace Facebook
@madd0
madd0 / ShellIcon.cs
Created December 5, 2011 11:43
Get a small or large Icon with an easy C# function call that returns a 32x32 or 16x16 icon.
// -----------------------------------------------------------------------
// <copyright file="ShellIcon.cs" company="Mauricio DIAZ ORLICH ([email protected])">
// Distributed under Microsoft Public License (MS-PL).
// http://www.opensource.org/licenses/MS-PL
// </copyright>
// -----------------------------------------------------------------------
/// <summary>
/// Get a small or large Icon with an easy C# function call
@madd0
madd0 / md5.cs
Created November 15, 2011 09:06
Create an MD5 hash digest in C#
public static string MD5Hash(string toHash)
{
string hashed;
using (MD5 md5 = MD5.Create())
{
hashed = string.Join(string.Empty, md5.ComputeHash(Encoding.UTF8.GetBytes(toHash)).Select(b => b.ToString("x2")));
}
return hashed;
@madd0
madd0 / queryString.cs
Created November 15, 2011 08:50
Create a URL query string from a NameValueCollection in C#
var nvc = new NameValueCollection
{
{ "key1", "value1" },
{ "key2", "value2" },
{ "key3", "" }
};
var builder = new UriBuilder("http://www.example.com");