Skip to content

Instantly share code, notes, and snippets.

View spirit11's full-sized avatar
😺

Valentin Tyrichev spirit11

😺
View GitHub Profile
@spirit11
spirit11 / notebook-deployment.yaml
Last active July 24, 2018 07:55
dask kubernetes
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
kompose.cmd: ./kompose convert
kompose.version: 1.9.0 (093c756)
creationTimestamp: null
labels:
io.kompose.service: notebook
name: notebook
@spirit11
spirit11 / registry.yaml
Last active May 4, 2018 10:39
docker container training
curl https://gist.githubusercontent.com/spirit11/1200dabdf0eb657d8dbdb47361d9a293/raw/b4e6c16c501d0ac8d6b4327eee8c18c63514d8c9/registry.yaml > registry.yaml
docker stack deploy --compose-file registry.yaml registry
git clone --depth 1 https://github.com/jpetazzo/container.training.git
cd container.training/stacks
docker-compose -f dockercoins.yml build
docker-compose -f dockercoins.yml push
docker stack deploy --compose-file dockercoins.yml dockercoins
@spirit11
spirit11 / structuremapfunc.cs
Created January 25, 2018 14:10
StructureMap Func injection #ta
void Main()
{
IContainer c = new Container(x =>
{
x.For<IUsedByA>().Use<UsedByA>();
x.For<IUsedByAOther>().Use<UsedByAOther>();
x.For<IA>().Use<A0>();
});
c.GetInstance<UseIA>();
c.GetInstance<UseA0WithOverride>();
using System;
/// <summary>
/// Extension class for pattern matching workaround in older version of C#
/// </summary>
public static class PatternMatchExtension
{
public interface IMatcher<T>
where T : class
{
@spirit11
spirit11 / AsyncCommand.cs
Created August 3, 2017 10:27
AsyncCommand
class AsyncCommand : ICommand, INotifyPropertyChanged
{
public AsyncCommand(Func<Task> Action)
{
action = Action;
canExecute = true;
}
public event EventHandler CanExecuteChanged;