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
@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 / MediatorExercise.swift
Created August 5, 2017 22:53
Swift mediator exercise
import Foundation
import XCTest
public protocol Disposable
{
func dispose()
}
protocol Invocable : class
{
using System;
using System.Collections.Generic;
using System.Threading;
namespace DesignPatterns
{
public class Person
{
public string Name;
@nesteruk
nesteruk / SharpKitPhantomJS
Created December 2, 2011 12:02
SharpKit interface definitions for PhantomJS
using SharpKit.JavaScript;
namespace PhantomJS
{
[JsType(JsMode.Prototype, Export = false, Name = "console")]
public static class Console
{
public static void log(string message) {}
}
using System;
using System.Linq;
namespace DotNetDesignPatternDemos.Structural.Adapter
{
// Vector2f, Vector3i
public interface IInteger
{
int Value { get; }
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.Proxy.Composite
{
// todo: publish
public class MasonrySettings
{
//public bool? All
//{
using System;
using System.ComponentModel;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using DotNetDesignPatternDemos.Annotations;
namespace DotNetDesignPatternDemos.Behavioral.Observer.Bidirectional
{
public class Product : INotifyPropertyChanged
#[derive(Debug)]
struct Person
{
name: String,
position: String
}
impl Default for Person
{
fn default() -> Self {
#define _USE_MATH_DEFINES
#include <iostream>
#include <cmath>
#include <immintrin.h>
// Standard normal probability density function
double norm_pdf(const double& x) {
return (1.0 / (pow(2 * M_PI, 0.5))) * exp(-0.5 * x * x);