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 IObservable<T> ToObservable<T>(this IQueryable<T> source) | |
{ | |
if (source == null) | |
throw new ArgumentNullException(nameof(source)); | |
IDbAsyncEnumerable<T> dbAsyncSource = source as IDbAsyncEnumerable<T>; | |
if (dbAsyncSource == null) | |
return source.AsEnumerable().ToObservable(); | |
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 Get-DirAlias ([string]$loc) { | |
# check if we are in our home script dir | |
# in that case return grave sign | |
if ($loc.Equals([Environment]::GetFolderPath("UserProfile"))) { | |
return "~" | |
} | |
# if it ends with \ that means we are in root of drive | |
# in that case return drive | |
$lastindex = [int] $loc.lastindexof("\") |
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.Net.Http; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Web.Http; | |
using System.Web.Http.Controllers; | |
using System.Web.Http.Metadata; | |
namespace Envicase.Bindings | |
{ |
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.Data; | |
using System.Linq; | |
using System.Reflection; | |
namespace DataTableMapper | |
{ | |
public class Item | |
{ |
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 Git-Ignore() { | |
param([Parameter(Mandatory=$true)][string[]]$list) | |
Invoke-RestMethod ("http://gitignore.io/api/" + [string]::Join(",",$list)) | |
} |
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 NinjectDependencyScope : IDependencyScope | |
{ | |
private IKernel _kernel; | |
public NinjectDependencyScope(IKernel kernel) | |
{ | |
Contract.Assert(kernel != null); | |
this._kernel = kernel; | |
} |
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.Reflection; | |
namespace DynamicLinq | |
{ | |
public static class DynamicLinqOperations | |
{ | |
private static MethodInfo orderByTemplate = typeof(Enumerable) |
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 string PropertyName<T>(Expression<Func<T>> expression) | |
{ | |
if (expression == null) | |
throw new ArgumentNullException("expression"); | |
var body = expression.Body as MemberExpression; | |
if (body == null) | |
throw new ArgumentException("Invalid expression", "expression"); |
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
var cluster = require('cluster') | |
, express = require('express') | |
, config = require('./config/config'); | |
if (cluster.isMaster) { | |
for (var i = 0; i < config.ports.length; i++) { | |
cluster.fork({ PORT: config.ports[i] }); | |
} | |
} else { | |
var app = express(); |
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
forever stop app.js |