This file contains 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
namespace System | |
{ | |
public static class ReverseForeach | |
{ | |
public static void ForEach<T>(this Action<T> action, IEnumerable<T> enumerable) | |
{ | |
foreach(var item in enumerable) | |
{ | |
action(item); | |
} |
This file contains 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
namespace System | |
{ | |
public static class SystemDate | |
{ | |
public static Func<DateTime> UtcNow { get; private set; } | |
static SystemDate() | |
{ | |
Reset(); | |
} |
This file contains 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 Index | |
{ | |
public static Index One = new Index(1); | |
public static Index Two = new Index(2); | |
public static Index Three = new Index(3); | |
public int Value { get; private set; } | |
public Index(int value) | |
{ |
This file contains 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
// http://www.interact-sw.co.uk/iangblog/2004/04/26/yetmoretimedlocking | |
using System; | |
using System.Threading; | |
// Thanks to Eric Gunnerson for recommending this be a struct rather | |
// than a class - avoids a heap allocation. | |
// Thanks to Change Gillespie and Jocelyn Coulmance for pointing out | |
// the bugs that then crept in when I changed it to use struct... | |
// Thanks to John Sands for providing the necessary incentive to make |
This file contains 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
;NOTE: Add the windows where this script is active here | |
GroupAdd, TextEditors, ahk_class TextPad4 | |
GroupAdd, TextEditors, ahk_class ConsoleWindowClass | |
#IfWinActive, ahk_group TextEditors | |
;NOTE: Is this a concatenated string acting as an array? | |
altkeys = (Join: LTrim | |
AppsKey, LWin, RWin, LControl, LShift, RShift, LAlt, RAlt | |
PrintScreen, CtrlBreak, Pause, Break |
This file contains 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
# Find all spec assemblies, lazy. | |
mspec_assemblies = FileList['bin/Release/*.Specs.dll'] | |
mspec_results = mspec_assemblies.pathmap("%X.results.xml") | |
# Try to solve the TeamCity build log problem by quieting the service messages | |
# and, instead, generating a test result file per assembly. The console messages | |
# are probably still useful (so do not include '--silent'). | |
task :generate_mspec_tasks do | |
mspec_assemblies.zip(mspec_results) do |name, result| | |
mspec name do |mspec| |
This file contains 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
namespace System | |
{ | |
public class Latch | |
{ | |
public static explicit operator Latch(bool isSet) | |
{ | |
return new Latch(isSet); | |
} | |
public static implicit operator bool(Latch latch) |
This file contains 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
def auto_add_dependencies(projects) | |
projects.each do |project| | |
each_project_dependency do |dependency| | |
@dependencies.push dependency | |
end | |
end | |
end | |
def get_packages_config(project) | |
return File.join File.dirname project, 'packages.config' |
This file contains 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
module InstallShield | |
class InstallShieldConfiguration | |
attr_accessor :command, :parameters, :ism, :product_version, :product_code | |
attr_reader :new_product_code | |
def initialize | |
@command = File.join ENV['ProgramFiles(x86)'], 'InstallShield/2010 StandaloneBuild/System/IsCmdBld.exe' | |
@parameters = [] | |
end |
This file contains 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 IAmAnAction | |
{ | |
void Handle(dynamic data = null); | |
} |
OlderNewer