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.Dynamic; | |
class GameObjectContainer : DynamicObject | |
{ | |
private readonly Dictionary<string, object> _values = new Dictionary<string, object>(); | |
public object Instance { get; private set; } |
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; | |
class Program | |
{ | |
static IEnumerable<int> Numbers() | |
{ | |
int i = 0; | |
while (true) |
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; | |
class Program | |
{ | |
static void Print(IEnumerable<int> array) | |
{ | |
foreach (var value in array) | |
{ |
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; | |
class Program | |
{ | |
static Func<int, dynamic> Atom(dynamic value) | |
{ | |
return index => value; | |
} | |
static Func<int, dynamic> Cons(Func<int, dynamic> a, Func<int, dynamic> b) |
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; | |
namespace GenericExample | |
{ | |
interface IWithValue | |
{ | |
int Value { get; set; } | |
} | |
class Foo : IWithValue |
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 IEnumerable<IEnumerable<T>> Batch<T>(this IEnumerable<T> collection, int batchSize) | |
{ | |
var list = collection.ToList(); | |
if (list.Any()) | |
{ | |
yield return list.Take(batchSize); | |
} | |
while (list.Any()) |
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; | |
namespace clojure_test | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var eval = clojure.lang.RT.var("clojure.core", "load-string"); |
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
def createEventHandler(value): | |
def eventHandler(): | |
print(value) | |
return eventHandler | |
button1Handler = createEventHandler("FUCK") | |
button2Handler = createEventHandler("SHIT") | |
button1Handler() |
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; | |
namespace WithExample | |
{ | |
static class IEnumerableExtension | |
{ | |
public static IEnumerable<T> With<T>(this IEnumerable<T> collection, Func<IEnumerable<T>, IEnumerable<T>> proc) | |
{ |
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
(defun throw-zigulka () | |
(interactive) | |
(dolist (font-family (font-family-list)) | |
(let ((str font-family)) | |
(insert (propertize (concat "o/ o/ o/ o/ o/ o/ o/ o/ o/ o/ o/ o/ o/ o/ (" str ")") | |
'face `((:family ,font-family)))) | |
(newline)))) | |
OlderNewer