Skip to content

Instantly share code, notes, and snippets.

View JayBazuzi's full-sized avatar

Jay Bazuzi JayBazuzi

View GitHub Profile
class HtmlRequestMessageData
{
public readonly string Content;
public readonly HttpMethod Method;
public readonly Uri RequestUri;
[JsonConstructor]
HtmlRequestMessageData(HttpMethod method, Uri requestUri, string content)
{
this.Method = method;
@JayBazuzi
JayBazuzi / cloudSettings
Last active August 28, 2020 19:24
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-28T19:24:37.953Z","extensionVersion":"v3.4.3"}
using System;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestProject1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
@JayBazuzi
JayBazuzi / MergeDownProcess.py
Created September 22, 2018 19:14
One way to factor a script for a multi-step process.
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 September 22, 2018 19:14
One way to factor a script for a multi-step process.
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 September 22, 2018 19:14
One way to factor a script for a multi-step process.
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()
var pipeline = new Pipeline(CharacterFile.From)
{
new ResultCollector<CharacterFile>(),
new Pipeline(ConfigFile.Matching)
{
new ResultCollector<ConfigFile>(),
},
new Pipeline(_ => _.ParseCards())
{
new ResultCollector<List<CardData>>(),
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);
@JayBazuzi
JayBazuzi / LegacyCharExampleSyntax.cs
Created February 19, 2019 02:41
- PipeSource is split into a StaticInputPipe and a PipeMiddle
// 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 February 19, 2019 02:41
- PipeSource is split into a StaticInputPipe and a PipeMiddle
// 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);