This file contains hidden or 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 StringExtensions | |
{ | |
public static string FormatIRC(this string input) | |
{ | |
return Regex.Replace(input, @"\[([^\]]*)\]\((.*?)\s*?\s*\)", (match) => { | |
var codes_portion = (match.Groups[1].Value).Split(' ', ','); | |
var color_check = new Func<string, ColorCode>((value) => Enum.TryParse(value, true, out ColorCode result) ? result : ColorCode.Invalid); | |
var control_check = new Func<string, ControlCode>((value) => Enum.TryParse(value, true, out ControlCode result) ? result : ControlCode.Invalid); |
This file contains hidden or 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
// JS array equivalents to C# LINQ methods - by Dan B. | |
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version): | |
// Here's a simple array of "person" objects | |
var people = [ | |
{ name: "John", age: 20 }, | |
{ name: "Mary", age: 35 }, | |
{ name: "Arthur", age: 78 }, | |
{ name: "Mike", age: 27 }, |
This file contains hidden or 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 DailyCoding.EasyTimer | |
{ | |
public static class EasyTimer | |
{ | |
public static IDisposable SetInterval(Action method, int delayInMilliseconds) |
This file contains hidden or 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.Text; | |
namespace NodeIPC | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var input = Console.OpenStandardInput(); |