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 class ReflectionExtensions | |
{ | |
public static Boolean Implements<T>(this Type typeToCheck) | |
{ | |
return typeToCheck.Implements(typeof(T)); | |
} | |
public static Boolean Implements(this Type typeToCheck, Type typeToCheckFor) | |
{ | |
if (typeToCheck == null || typeToCheckFor == null) return false; |
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.Linq; | |
using System.Text; | |
using Disruptor; | |
using Elasticity.Domain; | |
using Elasticity.Events; | |
namespace Elasticity.Domain | |
{ |
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.Linq; | |
using System.Text; | |
using System.Security.Principal; | |
namespace TechnoFattie.Lib.Tests.Mocks | |
{ | |
public enum MockPrincipalBehavior | |
{ |
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 Set-ConnectionString{ | |
[CmdletBinding(SupportsShouldProcess=$True)] | |
Param( | |
[string]$fileName="app.config", | |
[string]$connectionStringName, | |
[string]$connectionString | |
) | |
$config = [xml](Get-Content -LiteralPath $fileName) | |
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
# Name: Network Load Balancer Functions | |
# Description: Collection of functions for managing NLB on 2003 machines | |
# Author: Josh Carroll | |
Add-Type @' | |
public class NLBStatusCode | |
{ | |
public NLBStatusCode(int code, string name, System.ConsoleColor color){ | |
_code = code; | |
_name = name; |
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 class CacheHelper | |
{ | |
private static readonly Object _locker = new object(); | |
public static T GetCacheItem<T>(String key, Func<T> cachePopulate, TimeSpan? slidingExpiration = null, DateTime? absoluteExpiration = null) | |
{ | |
if(String.IsNullOrWhiteSpace(key)) throw new ArgumentException("Invalid cache key"); | |
if(cachePopulate == null) throw new ArgumentNullException("cachePopulate"); | |
if(slidingExpiration == null && absoluteExpiration == null) throw new ArgumentException("Either a sliding expiration or absolute must be provided"); |
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
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$True)] | |
[string]$projectPath, | |
[string]$filter='*.*', | |
[switch]$useRegularExpression=$False, | |
[switch]$undo=$False | |
) | |
$ErrorActionPreference = "Stop" |
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 (global) { | |
var toString = Object.prototype.toString; | |
var $console = global.console; | |
var util = { | |
//Lifted from LoDash | |
isString: function (value) { | |
return typeof value == 'string' || | |
(value && typeof value == 'object' && toString.call(value) == '[object String]') || false; |
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
/** | |
* Auto-generated code below aims at helping you parse | |
* the standard input according to the problem statement. | |
**/ | |
var mainNetwork = initializeNetwork(); | |
// game loop | |
while (true) { | |
var agentIndex = parseInt(readline()); |
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
class Foo { | |
constructor($http, $log, WhateverElse) { | |
// This is the boilerplate I'm talking about | |
this.$http = $http; | |
this.$log = $log; | |
this.whateverElse = WhateverElse; | |
// anytime I add something, I have to add it here | |
// anytime I remove something, I have to remove it from here | |
// I just don't really see what classes are getting me from | |
// a reusability/maintainability/readability/whatever standpoint. |
OlderNewer