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.Web; | |
using Matters.Helpers; | |
using HtmlAgilityPack; | |
namespace Matters.Helpers | |
{ | |
/* |
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 const string CharUnicodeFormat = "&#{0};"; | |
public static string EncodeUnicodeChars(this string text) { | |
if (text == null) { | |
throw new ArgumentNullException("text"); | |
} | |
return text.Aggregate( | |
new StringBuilder(), |
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; | |
namespace Builder_Algida_Row_Generator | |
{ | |
class GeneratorExtensions | |
{ | |
public LinkedList<TReturn> ApplyFunctionsWithHistory<TA1, TReturn>(TReturn arg1, TA1 arg2, |
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
# Dependency injetion example. | |
class House | |
# We are asking for things in contructor. | |
constructor: (@kitchen) -> | |
# Service locator antipattern example. | |
class House | |
constructor: -> | |
# our class is looking for kitchen | |
@kitchen = new Kitchen |
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 void ForEach<TSource>(this IEnumerable<TSource> source, Action<TSource> onNext) | |
{ | |
if (source == null) | |
{ | |
throw new ArgumentNullException("source"); | |
} | |
if (onNext == null) | |
{ | |
throw new ArgumentNullException("onNext"); | |
} |
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
from x in list | |
where x | |
let y = new { X = x } | |
orderby y.X | |
select y; |
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
module CodeRetreat | |
open Xunit | |
type Cell = | |
| DeadCell of int | |
| LiveCell of int | |
let hasChanceToLife (cell:Cell) = | |
match cell with |
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
$path = "~\AppData\Roaming\ncrunch2012\user.dat" | |
ri -Force $path |
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
Dependency Injection a Inversion of Control | |
https://twitter.com/geekovo/status/290061513300000768 | |
http://rarous.net/weblog/431-dip-ioc-a-di-dil-prvni.aspx | |
http://rarous.net/weblog/432-dip-ioc-a-di-dil-druhy.aspx | |
http://rarous.net/weblog/433-dip-ioc-a-di-dil-treti.aspx |
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 interface IStorage | |
{ | |
Uri Save(Stream data, string name); | |
Task<Stream> LoadAsync(Uri dataUri); | |
} |
OlderNewer