Skip to content

Instantly share code, notes, and snippets.

View AutofacResolveMultipleImplementations
namespace AutofacResolveMultipleImplementations.BusinessLogic
using System;
public enum Service
View hal.json
"_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
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;
stormoz / Covariance
Last active August 29, 2015 13:59
View Covariance
namespace CovarianceTests
using System.Collections.Generic;
using NUnit.Framework;
public class CovarianceTests
public void IEnumerableT_Is_Covariant()
View Maybe monad
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;
stormoz / install.bat
Last active February 10, 2022 08:57
Start Selenium Grid hub and nodes as Windows services
View install.bat
nssm install SeleniumHub java -jar C:\Selenium\selenium-server-standalone-2.48.2.jar -role hub
nssm start SeleniumHub
nssm install SeleniumNode1 java -jar C:\Selenium\selenium-server-standalone-2.48.2.jar -role node -hub http://localhost:4444/grid/register\Selenium\chromedriver.exe
nssm set SeleniumNode1 DependOnService SeleniumHub
nssm start SeleniumNode1
nssm install SeleniumNode2 java -jar C:\Selenium\selenium-server-standalone-2.48.2.jar -role node -hub http://localhost:4444/grid/register\Selenium\chromedriver.exe
nssm set SeleniumNode2 DependOnService SeleniumHub
nssm start SeleniumNode2
stormoz / inline css gulp task
Created January 18, 2016 01:06
inline css gulp task
View inline css gulp task
gulp.task('inline', function () {
console.log('Inline css');
return gulp.src( + "index.html")
.pipe(replace(/\<link .*?href=["']css\/styles\.css["'].*?[\/]{0,1}\>/, function(s) {
var style = fs.readFileSync( + "css/styles.css", 'utf8');
return '<style>\n' + style + '\n</style>';
stormoz / configure kdiff tree
Created January 18, 2016 02:15
configure kdiff tree
View configure kdiff tree
[difftool "kdiff3"]
path = C:/Progra~1/KDiff3/kdiff3.exe
trustExitCode = false
prompt = false
tool = kdiff3
[mergetool "kdiff3"]
View lazy and lazy require js
var Lazy = function (getFunc) {
var _value;
return {
get value() {
_value = getFunc();
return _value;
View js generators async patterns
function callAsync(fn) {
// get iterator
var gen = fn();
// used as a callback to currently yielded functions
function next() {
// get next function
var ret =;
// recursion exit condition