Skip to content

Instantly share code, notes, and snippets.

View nesteruk's full-sized avatar
🍸
retired

Dmitri Nesteruk nesteruk

🍸
retired
  • Mesa Funds
View GitHub Profile
using System;
using System.Diagnostics;
namespace DotNetDesignPatternDemos.Structural.Proxy.ValueProxy
{
[DebuggerDisplay("{value*100.0f}%")]
public struct Percentage
{
private readonly float value;
using System;
using System.Linq;
namespace DotNetDesignPatternDemos.Structural.Adapter
{
// Vector2f, Vector3i
public interface IInteger
{
int Value { get; }
using System;
using System.Collections.Generic;
using System.Threading;
namespace DesignPatterns
{
public class Person
{
public string Name;
@nesteruk
nesteruk / MediatorExercise.swift
Created August 5, 2017 22:53
Swift mediator exercise
import Foundation
import XCTest
public protocol Disposable
{
func dispose()
}
protocol Invocable : class
{
@nesteruk
nesteruk / SwiftSubsequenceMindfuck.swift
Created August 4, 2017 21:17
Swift sequence-of-sequences mindfindfuck
import Foundation
import XCTest
class SingleValue : Sequence
{
var value = 0
init() {}
init(_ value: Int)
{
@nesteruk
nesteruk / BuilderFacets.rs
Created July 24, 2017 13:16
Fluent builder with lifetime/references removed... doesn't compile.
use std::marker::PhantomData;
use std::rc::Rc;
use std::fmt::Display;
struct Person
{
street_address: String,
postcode: String,
city: String,
@nesteruk
nesteruk / BuilderFacets.rs
Created July 24, 2017 12:54
Lifetime chaos when defining faceted builders for a simple type
use std::marker::PhantomData;
struct Person
{
street_address: String,
postcode: String,
city: String,
company_name: String,
position: String,
public class MyClass
{
static void Main(string[] args)
{
Console.WriteLine("test");
}
}
library ieee;
use ieee.std_logic_1164.all;
entity combination_lock is
port (
key : in std_logic_vector(3 downto 0);
hex3, hex2, hex1, hex0 : out std_logic_vector(0 to 6);
clock_50: in std_logic
);
end entity;
@nesteruk
nesteruk / part_fail.vhd
Created November 29, 2016 14:49
Partial failure in record type update
library ieee;
use ieee.std_logic_1164.all;
library ps;
use ps.hex_conv.all;
entity light is
port(
clock_50 : in std_logic;
hex0, hex1, hex2, hex3 : out std_logic_vector(0 to 6);
key : in std_logic_vector(0 to 3);