Skip to content

Instantly share code, notes, and snippets.

public class EngageIdentity : IIdentity
{
private readonly string _name;
public EngageIdentity(string name)
{
_name = name;
}
public string Name
@fschwiet
fschwiet / phil-bios.md
Created December 28, 2011 05:27 — forked from haacked/phil-bios.md
Phil's Bios

I'm often asked to provide a bio, such as when speaking. I haven't been happy with what I've provided so far so I thought I'd try a few samples and see if I could get some feedback. :)

Bio 1 - the irreverent

Phil Haack is awful at writing speaker bios, hates referring to himself in the third person, but is good at doing what he's told. He works at GitHub bringing social coding, rainbows, and unicorns to .NET and Windows developers. Prior to GitHub, Phil worked at Microsoft shipping software such as ASP.NET MVC, NuGet, and other odds and ends.

Phil was a co-author of the infamous 4-forehead book on ASP.NET MVC and is a regular speaker at conferences around the world, but loves speaking at {{your conference here}} most of all!

For more about Phil, check out his blog at http://haacked.com/ or his Twitter account http://twitter.com/#!/haacked.

Bio 2 - the odd

@fschwiet
fschwiet / gist:1324940
Created October 29, 2011 19:04
an interesting bit of code. An http endpoint as minified resources main.js, main.test.js, main.css, main.ie.css, main.print.css.
public class StaticResources : NancyModule, IResourceBundler
{
public StaticResources()
{
this.isAvailableAt("cdn/");
this.includesFiles(
@"lib\jquery",
@"lib\jquery-ui-1.8.16\jquery.ui.core.js",
@"lib\jquery-ui-1.8.16\jquery.ui.widget.js",
@fschwiet
fschwiet / gist:1302170
Created October 20, 2011 20:01
install IIS via powershell
#
# http://technet.microsoft.com/en-us/library/cc722041%28v=WS.10%29.aspx
#
# Feature names are case-sensitive, and you will get no warnings if you mispell a feature or
# do not include prerequisite features first. Proceed with care.
#
function InstallFeature($name) {
cmd /c "ocsetup $name /passive"
@fschwiet
fschwiet / gist:1172142
Created August 25, 2011 22:12
learned something C# & new today
public class Class1 : IEnumerable
{
public void can_use_creation_shorthand_with_arbitrary_class_supporting_Add()
{
var hmm = new Class1()
{
{1,2},
{3,4}
};
}
@fschwiet
fschwiet / gist:1075367
Created July 11, 2011 05:58
Microsoft.IIS.PowerShell.Framework.INamespaceNode
namespace Microsoft.IIS.PowerShell.Framework {
public interface INamespaceNode
{
// Methods
bool AddProperty(string propertyName, string propertyType, object index, bool force, object value);
void ClearData(ServerManager sm);
bool ClearProperty(Collection<string> propertyToClear);
PSObject GetProperty(Collection<string> providerSpecificPickList, object atIndex);
bool RemoveProperty(string propertyName, object index);
public class ProductExtender : AbstractOperation
{
private IDocumentStore _store;
private Type _type;
private Dictionary<string, string> _fields;
public ProductExtender(IDocumentStore store, Type type, Dictionary<string, string> fields)
{
_store = store;
_type = type;
@fschwiet
fschwiet / consolechanges.mkd
Created February 23, 2011 04:49
nunit console changes for fixture failures

First let me state the changes are console only, I think the GUI behavior is intuitive.

NUnit-console's return values are to be changed.

existing return codes:

	public static readonly int OK = 0;
	public static readonly int INVALID_ARG = -1;
	public static readonly int FILE_NOT_FOUND = -2;

public static readonly int FIXTURE_NOT_FOUND = -3;

Writing blocks of code:
${EXPR} => write result of expression as encoded string
!{EXPR} => write result of expression as unencoded string
[[,]] => <, > (when in a codeblock outside a string literal, used for generics)
'string' => "string" (when in a codeblock)
<use namespace="..."/>
Manipulating variables:
# Git functions
# Mark Embling (http://www.markembling.info/)
# Is the current directory a git repository/working copy?
function isCurrentDirectoryGitRepository {
if ((Test-Path ".git") -eq $TRUE) {
return $TRUE
}
# Test within parent dirs