Skip to content

Instantly share code, notes, and snippets.

@johnterickson
johnterickson / gist:0467c3311d62fcbb1e81d90e38a68dff
Created March 4, 2025 18:47
one-way git repo synchronization with shallow clone
export DESTINATION=[git URL]
export SOURCE=[git URL]
export BRANCH=main
# shallow clone of the destination - this should be at or behind the source
git clone --no-tags --progress --no-recurse-submodules --depth=1 $DESTINATION
git checkout $BRANCH
# add the source
git remote add source $SOURCE
# fetch only the delta
git fetch source $BRANCH
{
"pineapple_on_pizza": "true"
}
@johnterickson
johnterickson / Program.cs
Created June 8, 2020 15:50
ActionBlock fun
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
namespace ActionBlockTest
{
class Program
{
@johnterickson
johnterickson / pipelines.yml
Created May 24, 2019 21:29
Capture CPU usage in Azure Pipelines
- script: |
mkdir %CD%\trace
- script: |
logman create counter BuildCounters -si 00:05 -f csv -o %CD%\trace\perf.csv
- script: |
logman update BuildCounters -c "\Processor(_Total)\%% Processor Time"
- script: |
logman start BuildCounters
# do stuff
- script: |