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
var fs = require('fs'); | |
fs.readFile('package.json', 'utf8', function(err, data){ | |
console.log("reading package.json"); | |
if (err) throw err; | |
obj = JSON.parse(data); | |
if (obj.devDependencies) { |
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
var fs = require('fs'); | |
fs.readFile('package.json', 'utf8', function(err, data){ | |
console.log("reading package.json"); | |
if (err) throw err; | |
obj = JSON.parse(data); | |
if (obj.devDependencies) { |
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 int ExecuteSql(string sql, object parameters = null) | |
{ | |
int result; | |
using (var connection = ConnectToDb()) | |
using (var command = new SqlCommand(sql, connection)) | |
{ | |
Log.Info(sql); | |
if (parameters != null) |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Text.RegularExpressions; | |
using System.Xml; | |
using System.Xml.Linq; | |
namespace Formix.Utils | |
{ | |
class Program |
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
function Install-Java7JRE() | |
{ | |
# 7.0.79 | |
$url = "http://javadl.sun.com/webapps/download/AutoDL?BundleId=106369" | |
$filename = "jre-7u79-windows-x64.exe" | |
$downloadedFile = Join-Path $env:TEMP $filename | |
$javaHome = Join-Path $env:ProgramFiles "Java\jre7" | |
$jreForPathVariable = Join-Path $javaHome 'bin' | |
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 static void ConfigureToUseSqlite(this IKernel kernel) | |
{ | |
var nHibernateConfiguration = Substitute.For<INHibernateConfiguration>(); // custom interface | |
var msSqlConfiguration = SQLiteConfiguration.Standard | |
.InMemory() | |
.ShowSql() | |
; | |
nHibernateConfiguration.GetPersistenceConfiguration().Returns(msSqlConfiguration); |
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 InjectionBinding | |
{ | |
public Type RegistrationKey { get; set; } | |
public IList<object> Implementations { get; set; } | |
public Type[] GetImplementationTypes() | |
{ | |
return Implementations.Select(row => row.GetType()).ToArray(); | |
} | |
} | |
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
[Test] | |
public void ApiDocumentation() | |
{ | |
// Arrange | |
var builder = Substitute.For<IBuilder>(); | |
builder.Create<string>().From(5.0m).Returns("Five"); | |
// Act | |
var result = builder.Create<string>().From(5.0m); | |
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 ICommand<in TRequest, out TResponse> : IDisposable | |
{ | |
TResponse Execute(TRequest request); | |
} | |
/// <summary> | |
/// Use Request.Empty when the command doesn't need any arguments. | |
/// </summary> | |
public class Request | |
{ |
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 IMapper | |
{ | |
IMapperLink From<TInput>(TInput input); | |
} | |
public interface IMapperLink | |
{ | |
TOutput To<TOutput>(); | |
} |