Skip to content

Instantly share code, notes, and snippets.

@ionuttamas
ionuttamas / SimpleTestFinder.ipynb
Last active February 17, 2022 09:21
Test finder based on generated data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"use latest";
var Twitter = require('twitter');
var handlebars = require('handlebars');
var params = {screen_name: 'realDonaldTrump'};
var view = `<html>
<head>
<title>Our favorite president tweets</title>
</head>
<body>
@ionuttamas
ionuttamas / Program.cs
Created November 20, 2015 22:40
Ref vs Queue for tree traversal
using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace ConsoleApplication13
{
internal class Node
{
public string Value { get; set; }
public List<Node> Children { get; set; }
@ionuttamas
ionuttamas / Main.cs
Last active November 15, 2015 15:58
Codility questions
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication5
{
internal class Program
@ionuttamas
ionuttamas / List.cs
Last active October 11, 2015 09:55
Lock-free list implementation
public class List<T>:IEnumerable<T>
{
private readonly T _sentinel;
private readonly Node<T> _head;
public List()
{
_head = new Node<T>();
_sentinel = default(T);
}
@ionuttamas
ionuttamas / EnumerableExtensions
Last active August 29, 2015 14:23
Runtime expression builder
public static IEnumerable<T> WhereByFilter<T>(this IEnumerable<T> collection, Expression filter)
{
dynamic dynamicFilter = filter;
dynamic function = dynamicFilter.Compile();
dynamic result = Enumerable.Where(collection, function);
return result;
}