Skip to content

Instantly share code, notes, and snippets.

View miou-gh's full-sized avatar

miou miou-gh

  • Canada
View GitHub Profile
@kevinswiber
kevinswiber / Program.cs
Created November 23, 2011 23:05
Passing messages between Node.js and C#.
using System;
using System.Text;
namespace NodeIPC
{
class Program
{
static void Main(string[] args)
{
var input = Console.OpenStandardInput();
@CipherLab
CipherLab / EasyTimer
Created July 11, 2014 15:12
Javascript style interval/timeout in c#
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)
@DanDiplo
DanDiplo / JS-LINQ.js
Last active July 19, 2024 03:02
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// 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 },
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);