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 Microsoft.VisualStudio.TestTools.UnitTesting; | |
using TDD.CalculatorImpl; | |
namespace TDD.UnityTests | |
{ | |
[TestClass] | |
public class CaculatorTests | |
{ | |
private ICalculator _calculator; |
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 abstract class InstanceResolverFor<SomeType> | |
{ | |
public static Func<SomeType> InstanceBuilder = () => | |
{ | |
throw new Exception(string.Format("The type '{0}' does not have a valid factory.", typeof(SomeType).FullName)); | |
}; | |
public static SomeType Instance { get { return InstanceBuilder(); } } | |
} |
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
/// SimpleLocker class avaliable at: https://gist.github.com/felipegtx/6107975 | |
public sealed class SingletonFor<TheType> | |
{ | |
private static Func<TheType> _instanceBuilder = null; | |
private Func<TheType> _constructorCall = null; | |
private SimpleLocker _locker = null; | |
private bool _isInitialized = false; | |
private TheType _instance; | |
public bool IsInitialized { get { return _locker.Read(() => _isInitialized); } } |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title></title> | |
<style> | |
table tr td | |
{ | |
height: 2px; | |
} |
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.IO; | |
using System.Linq; | |
namespace Desafio2 | |
{ | |
class Program | |
{ | |
private static string[] EXTENSIONS = new string[] { | |
".exe", ".log", ".pdb", ".js", ".html", ".htm", |
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 class Program | |
{ | |
static Func<int> Identity(int x) | |
{ | |
return () => x; | |
} | |
static Func<int, Func<int>> Multiply(Func<int> what) | |
{ |
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.Threading; | |
namespace Threading | |
{ | |
public sealed class SimpleLocker | |
{ | |
private ReaderWriterLockSlim _locker = new ReaderWriterLockSlim(); | |
private int _lockTimeout = 1000; |
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.Diagnostics; | |
namespace YCombinatorCSharp | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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
/// <reference path="../jQueryMin.js" /> | |
(function (window) { | |
var miniRT = (function () { | |
var configuracoesBasicas = { | |
nomePlugin: "Default", | |
intervalo: 5000, | |
iniciarAutomaticamente: true, |
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
/// https: //gist.github.com/felipegtx/3974654 | |
(function (window) { | |
window.Base = (function () { | |
var publicMembers = { | |
CreatePropertyBag: function (owner, defaults) { | |
/// <summary> |