var container = new TinyIoCContainer();
container.Register<ICar, ChittyBangBang>();
container.Register<ICar, Herbie>("Beetle");
var actual = container
.ResolveBuilder()
.WithOverload<ICar>("car", "Beetle")
.Resolve();
<?php | |
/*** | |
* Calculates the Luhn checksum. | |
* @param $s (string) the string to check., | |
* @return mixed FALSE if $s does not consists only of decimal digits, otherwise the luhn checksum is returned. | |
*/ | |
function luhn_calc($s) { | |
settype($s, 'string'); | |
if (!ctype_digit($s)) return false; |
# If you use MyGet.org at your company, this script can be modified and distributed to help your | |
# developers set up MyGet.org access. | |
$feedUrl = "https://www.myget.org/F/CHANGEME/" | |
$feedName = "ChangeMe" | |
$nuget = Read-Host "Enter path to NuGet.exe" | |
echo "" | |
echo "You need your API Key. It can be obtained from MyGet.org" |
#!/bin/bash | |
alias which='type -a' | |
alias ..='cd ..' | |
alias dev='cd /c/dev/' | |
alias path='echo -e ${PATH//:/\\n}' | |
alias ls='ls -hF --color' # add colors for filetype recognition | |
alias la='ls -Al' # show hidden files | |
alias lx='ls -lXB' # sort by extension |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace MicroIoC | |
{ | |
public interface IMicroIoContainer | |
{ | |
object Resolve(Type type); | |
T Resolve<T>(Type type) where T : class; |
var container = new TinyIoCContainer();
container.Register<ICar, ChittyBangBang>();
container.Register<ICar, Herbie>("Beetle");
var actual = container
.ResolveBuilder()
.WithOverload<ICar>("car", "Beetle")
.Resolve();
using System.IO; | |
namespace System.Reflection | |
{ | |
public static class AssemblyManifestResourceStreamExtensions | |
{ | |
public static Stream OpenManifestResourceStream(this Assembly assembly, string name) | |
{ | |
if (assembly == null) throw new ArgumentNullException("assembly"); | |
var result = assembly.GetManifestResourceStream(name); |
using System; | |
using System.IO; | |
using System.Runtime.Serialization; | |
using System.Runtime.Serialization.Json; | |
using System.Xml.Serialization; | |
using Newtonsoft.Json; | |
using NUnit.Framework; | |
namespace Lab | |
{ |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using NUnit.Framework; | |
namespace TestPad | |
{ | |
public class Tests | |
{ | |
[Test] |
using System; | |
using System.Threading; | |
namespace Example | |
{ | |
public static class ThreadPond | |
{ | |
public static void QueueUserWorkItem<T1>(Action<T1> callback, T1 arg1) | |
{ | |
if (callback == null) throw new ArgumentNullException(nameof(callback)); |
namespace Trine.CLI | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
new Crash | |
{ | |
Inner = {Name = "what"} | |
}; |