Skip to content

Instantly share code, notes, and snippets.

Jay Bazuzi JayBazuzi

View GitHub Profile
View LegacyCharExampleSyntax.cs
//
// - PipeSource is split. The "take a static input" is one part. The "execute a function and broadcast the result" is another.
//
// - A FunctionPipe is like PipeMiddle, with the specific purpose of applying an A->B function to each item in the pipeline. Its last ctor parameter is the thing it listens to. (Assume it calls `predecessor.AndNext(this)`)
//
// - An overloaded FunctionPipe ctor takes a string, to identify it in the ASCII art, when the function is a lambda that doesn't have a friendly name.
// var characterFile = CharacterFile.From(fileName);
var fileNamePipe = StaticInputPipe.Of(fileName);
var characterFile = FunctionPipe.Of(CharacterFile.From, fileNamePipe);
@JayBazuzi
JayBazuzi / LegacyCharExampleSyntax.cs
Created Feb 19, 2019
- PipeSource is split into a StaticInputPipe and a PipeMiddle
View LegacyCharExampleSyntax.cs
// var characterFile = CharacterFile.From(fileName);
var fileName = new StaticInputPipe(fileName);
var characterFile = new FunctionPipe(CharacterFile.From, fileName);
// var configFile = ConfigFile.Matching(characterFile);
var configFile = new FunctionPipe(ConfigFile.Matching, characterFile);
// var partialCards = characterFile.ParseCards();
var partialCards = new FunctionPipe("CharacterFile.ParseCards", _ => _.ParseCards(), characterFile);
@JayBazuzi
JayBazuzi / LegacyCharExampleSyntax.cs
Created Feb 19, 2019
- PipeSource is split into a StaticInputPipe and a PipeMiddle
View LegacyCharExampleSyntax.cs
// var characterFile = CharacterFile.From(fileName);
var fileName = new StaticInputPipe(fileName);
var characterFile = new FunctionPipe(CharacterFile.From, fileName);
// var configFile = ConfigFile.Matching(characterFile);
var configFile = new FunctionPipe(ConfigFile.Matching, characterFile);
// var partialCards = characterFile.ParseCards();
var partialCards = new FunctionPipe("CharacterFile.ParseCards", _ => _.ParseCards(), characterFile);
View DoEverything.cpp
CharacterData MakeAllTheViewModels(
const std::string& fileName, const std::string& username, const std::string& password)
{
auto characterFile = CharacterFile::From(fileName);
auto configFile = ConfigFile::Matching(characterFile);
auto partialCards = characterFile.ParseCards();
auto localCards = configFile.ParseCards();
auto compendiumService = CompendiumService::Authenticate(username, password);
auto cardService = CardService::Authenticate(username, password);
View IniitalizePipeline.cs
var pipeline = new Pipeline(CharacterFile.From)
{
new ResultCollector<CharacterFile>(),
new Pipeline(ConfigFile.Matching)
{
new ResultCollector<ConfigFile>(),
},
new Pipeline(_ => _.ParseCards())
{
new ResultCollector<List<CardData>>(),
@JayBazuzi
JayBazuzi / MergeDownProcess.py
Created Sep 22, 2018
One way to factor a script for a multi-step process.
View MergeDownProcess.py
def main():
return (MergeDownProcess(_WORKSPACE_DIR)
.get_user_intent()
.ensure_on_sparse_branch()
.ensure_no_files_opened()
.ensure_something_to_integrate()
.merge()
.create_changelist_for_any_changes()
.ensure_resolved()
.submit_any_changes()
@JayBazuzi
JayBazuzi / MergeDownProcess.py
Created Sep 22, 2018
One way to factor a script for a multi-step process.
View MergeDownProcess.py
def main():
return (MergeDownProcess(_WORKSPACE_DIR)
.get_user_intent()
.ensure_on_sparse_branch()
.ensure_no_files_opened()
.ensure_something_to_integrate()
.merge()
.create_changelist_for_any_changes()
.ensure_resolved()
.submit_any_changes()
@JayBazuzi
JayBazuzi / MergeDownProcess.py
Created Sep 22, 2018
One way to factor a script for a multi-step process.
View MergeDownProcess.py
def main():
return (MergeDownProcess(_WORKSPACE_DIR)
.get_user_intent()
.ensure_on_sparse_branch()
.ensure_no_files_opened()
.ensure_something_to_integrate()
.merge()
.create_changelist_for_any_changes()
.ensure_resolved()
.submit_any_changes()
View FizzBuzz-Kata-2018-07-11.cs
using System;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestProject1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
@JayBazuzi
JayBazuzi / cloudSettings
Last active Oct 6, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2018-10-06T15:27:13.617Z","extensionVersion":"v3.1.2"}
You can’t perform that action at this time.