View AutofacResolveMultipleImplementations
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 AutofacResolveMultipleImplementations.BusinessLogic | |
{ | |
using System; | |
public enum Service | |
{ | |
Foo, | |
Bar | |
} |
View hal.json
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
{ | |
"_links": { | |
"self": { "href": "/orders" }, | |
"next": { "href": "/orders?page=2" }, | |
"find": { "href": "/orders{?id}", "templated": true } | |
}, | |
"_embedded": { | |
"orders": [{ | |
"_links": { | |
"self": { "href": "/orders/123" }, |
View FunqIoC_ConventionTests
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 FunqConventionTests | |
{ | |
using Funq;//Install-Package Funq | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using MyNamespace; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; |
View Covariance
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 CovarianceTests | |
{ | |
using System.Collections.Generic; | |
using NUnit.Framework; | |
public class CovarianceTests | |
{ | |
[Test] | |
public void IEnumerableT_Is_Covariant() | |
{ |
View Maybe monad
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 NUnit.Framework; | |
using Shouldly; | |
namespace IoC.Site.Tests.ParallelTests | |
{ | |
//Maybe monad | |
public sealed class Maybe<T> where T : class | |
{ | |
private readonly T _value; |
View inline css gulp task
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
gulp.task('inline', function () { | |
console.log('Inline css'); | |
return gulp.src(config.build + "index.html") | |
.pipe(replace(/\<link .*?href=["']css\/styles\.css["'].*?[\/]{0,1}\>/, function(s) { | |
var style = fs.readFileSync(config.build + "css/styles.css", 'utf8'); | |
return '<style>\n' + style + '\n</style>'; | |
})) | |
.pipe(gulp.dest(config.buildDir)); | |
}); |
View configure kdiff tree
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
#from http://stackoverflow.com/questions/6412516/configuring-diff-tool-with-gitconfig | |
[difftool "kdiff3"] | |
path = C:/Progra~1/KDiff3/kdiff3.exe | |
trustExitCode = false | |
[difftool] | |
prompt = false | |
[diff] | |
tool = kdiff3 | |
[mergetool "kdiff3"] |
View lazy and lazy require js
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 Lazy = function (getFunc) { | |
var _value; | |
return { | |
get value() { | |
if(!_value){ | |
_value = getFunc(); | |
} | |
return _value; |
View js generators async patterns
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 callAsync(fn) { | |
// get iterator | |
var gen = fn(); | |
// used as a callback to currently yielded functions | |
function next() { | |
// get next function | |
var ret = gen.next(); | |
// recursion exit condition |
View async patterns with generators and promises
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 callAsync(fn) { | |
// get iterator | |
var iterator = fn(); | |
// used as a callback to currently yielded functions | |
function next() { | |
// get next function | |
var current = iterator.next(); | |
// recursion exit condition |
OlderNewer