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
<div id="foo"><div class="bar">Baz</div></div> |
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 ClientA | |
{ | |
public virtual List<Invoice> Invoices { get; set; } | |
//... | |
public Product GetMostBuyedProduct(DateTime from, DateTime to) | |
{ | |
//... | |
} |
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 TableCountryMappingCollection : ConfigurationElementCollection, IList<TableCountryMapping> | |
{ | |
//... | |
IEnumerator<TableCountryMapping> IEnumerable<TableCountryMapping>.GetEnumerator() | |
{ | |
foreach (var item in ((System.Collections.IEnumerable)this).Cast<TableCountryMapping>()) | |
yield return item; | |
} | |
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() |
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
internal static class IEnumerableExtensions | |
{ | |
private static Random _random = new Random(); | |
public static T RandomElement<T>(this IEnumerable<T> list) | |
{ | |
var index = _random.Next(list.Count()); | |
return list.ElementAt(index); | |
} | |
} |
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 ThreadingClass | |
{ | |
private static Random rnd = new Random(); | |
public void StartSomeWork() | |
{ | |
var threadNumber = 0; | |
var threadStart = new ThreadStart(() => | |
{ | |
Thread.CurrentThread.Name = string.Format("Thread {0}", ++threadNumber); |
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 Program | |
{ | |
static void Main(string[] args) | |
{ | |
long number = 4278; | |
var t = new Thread(() => FactorNumber(number, FactorizationDone)); | |
t.Start(); | |
t.Join(); | |
Console.ReadKey(); |
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 Program | |
{ | |
static void Main(string[] args) | |
{ | |
StartWork(); | |
Console.WriteLine("Processing is happening right now.."); | |
Console.ReadKey(); | |
} | |
static async Task StartWork() |
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
@media screen and (max-device-width: 480px) { | |
menu { | |
display: none; | |
} | |
} |
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
// {{#each_with_index records}} | |
// <li class="legend_item{{index}}"><span></span>{{Name}}</li> | |
// {{/each_with_index}} | |
Handlebars.registerHelper("each_with_index", function(array, block) { | |
var buffer = ""; | |
for (var i = 0, j = array.length; i < j; i++) { | |
var item = array[i]; | |
// stick an index property onto the item, starting with 0, may make configurable later |
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>Arkanoid with canvas</title> | |
<link rel="stylesheet" type="text/css" href="arkanoid.css"> | |
<script type="text/javascript" src="arkanoid.js"></script> | |
</head> | |
<body onload="arkanoid.init();"> | |
</body> | |
</html> |
OlderNewer