Skip to content

Instantly share code, notes, and snippets.

View JayBazuzi's full-sized avatar

Jay Bazuzi JayBazuzi

View GitHub Profile
@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()
using System;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestProject1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
@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"}
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;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
class PlaybackHtmlMessageHandler : HttpClientHandler
@JayBazuzi
JayBazuzi / Get, Set, m_.cpp
Last active August 12, 2017 21:11
C++ value type styles
class Size
{
int m_width;
int m_height;
public:
Size(int width, int height)
: m_width(width)
, m_height(height)
{}
factorial ratio
1
2 2x
3 1.5x
5 1.7x
8 1.6x
13 1.6x
20 1.5x
40 2x
@JayBazuzi
JayBazuzi / perforce-current-synced-changelist.py
Created May 10, 2017 00:34
Perforce allows each file in a client to be at a different revision, making it sometimes impossible to ask the question "to which changelist is this client synced?" This script checks if all files are at the same changelist before reporting that CL.
#!/usr/bin/env python
import argparse
from P4 import P4
p4 = P4()
p4.connect()
def main():
argparse.ArgumentParser(description="Verify that all files synced to the same changelist, and sets ERRORLEVEL to the count of unsynced files.").parse_args()
client = p4.fetch_client()['Client']