This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using ScrewTurn.Wiki.PluginFramework; | |
using ScrewTurn.Wiki; | |
using System.Text.RegularExpressions; | |
namespace DevCentral.ScrewTurnProviders | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (test-path function:\prompt) { | |
$oldPrompt = ls function: | ? {$_.Name -eq "prompt"} | |
remove-item -force function:\prompt | |
} | |
function prompt { | |
function getGitStatus { | |
$branch = git branch 2>&1 | |
if($branch.Exception -eq $null) { | |
$status = "git" | |
$branch | foreach { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
return IsTrue(val); | |
} | |
catch | |
{ | |
return IsFalse(val); | |
} | |
// moar koad |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IJudgeDread | |
{ | |
void IAmTheLaw(); | |
} | |
public interface IRoboCop : IJudgeDread | |
{ | |
void ServeThePublicTrust(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace MostlyScottish { | |
//This is what I think we should move towards | |
public interface IRepository<T> { | |
void Save(T entity); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static T TryParse<T>(this string stringToParse) { | |
if (typeof(T).HasMethod("TryParse")) { | |
var m = typeof(T).GetMethod("TryParse", new Type[] { typeof(string), typeof(T).MakeByRefType() }); | |
T outParam = Activator.CreateInstance<T>(); | |
object[] ps = new object[] { stringToParse, outParam }; | |
bool result = (bool)m.Invoke(null, ps); | |
if (result) | |
return (T)ps[1]; | |
} | |
return default(T); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ScrewturnPageKeyword | |
{ | |
private int? _hashCode; | |
public virtual string Page { get; set; } | |
public virtual string Namespace { get; set; } | |
public virtual int Revision { get; set; } | |
public virtual string Keyword { get; set; } | |
public override bool Equals(object obj) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PageKeywordMappings : ClassMap<ScrewturnPageKeyword> | |
{ | |
public PageKeywordMappings() | |
{ | |
Table("PageKeyword"); | |
CompositeId() | |
.KeyProperty(m => m.Page) | |
.KeyReference(m => m.Keyword) | |
.KeyReference(m => m.Namespace); | |
Map(m => m.Namespace); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function find(root, obj) { | |
var seen = []; | |
function search(root, name, depth) { | |
if (root === obj) { | |
console.log(name); | |
return; | |
} | |
if (!depth) { return; } | |
if (seen.indexOf(root) >= 0) { return; } | |
if (typeof root !== "object") { return; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Xunit; | |
using VirtualRoundtableData; | |
using System; | |
using Models; | |
namespace UnitTests | |
{ | |
public class when_using_the_user_repository: TestBase | |
{ |