Skip to content

Instantly share code, notes, and snippets.

View siroky's full-sized avatar
👨‍💻

Honza Široký siroky

👨‍💻
View GitHub Profile
var context = require.context('./Scripts/Sources/', true, /^\.\/.*\.js$/);
var _ = require('underscore');
window.require = function (m, callback) {
if (_.isFunction(callback)) {
if (_.isArray(m)) {
callback(_.map(m, window.require));
} else {
callback(window.require(m));
}
@siroky
siroky / TypeMatch.cs
Created January 25, 2015 22:14
Type Match in C# using FuncSharp
class Parent { }
class A : Parent { public string A { get; private set; } }
class B : Parent { public string B { get; private set; } }
class C : Parent { public string C { get; private set; } }
public class Test
{
public string TestWithoutFuncSharp(Parent p)
{
var a = p as A;
@siroky
siroky / Functor.cs
Created December 21, 2014 15:40
Functor in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace FuncSharp
{
public interface IFunctor<FA, FB, A, B>
{
FB Map(FA fa, Func<A, B> f);