Skip to content

Instantly share code, notes, and snippets.

Avatar

Ross Presser rpresser

View GitHub Profile
@rpresser
rpresser / image-1.vec
Created Aug 6, 2021
Excerpt from the "VECTORIALIMAGES" file that defines all the lines and boxes in the PDF version of the NYT Crossword from 2021-08-06.
View image-1.vec
<?xml version="1.0" encoding="utf-8"?>
<!-- Excerpt from the "VECTORIALIMAGES" file that defines
all the lines and boxes in the PDF version of the NYT Crossword from 2021-08-06.
One of the two files generated by pdftoxml on the file Aug0621.pdf -->
<VECTORIALIMAGES>
<!-- This clipping region defines the page size -->
<CLIP sid="p1_s1" x="0" y="0" width="612" height="792" idClipZone="p1_c1">
<GROUP sid="p1_s2" closed="true">
<M x="0" y="792" />
<L x="612" y="792" />
@rpresser
rpresser / Aug0621.xml
Created Aug 6, 2021
Part of the xml output from pdftoxml against the NYT crossword PDF download from 2021-08-06
View Aug0621.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- This is an excerpt from the output of pdftoxml against the NYT crossword PDF download from 2021-08-06.
-->
<!-- the XML header. Get the page width from PAGE; you can use it to separate clues from boxes.
Note that all PDF coordinates are in points (72 points to the inch). -->
<DOCUMENT>
<METADATA>
<PDFFILENAME>Aug0621.pdf</PDFFILENAME>
<PROCESS name="pdftoxml" cmd="">
<VERSION value="2.0">
View TransformOctopusConfig.ps1
<#
.Synopsis
"take in a variable JSON file from a drop target, a web.config, and a web.foo.config transform file and spit out a transformed file with the final substitutions."
.DESCRIPTION
This script is for previewing the common workflow of substituting OctopusDeploy variables within a *.foo.config transform file, then applying that transform file
to a *.config file.
.NOTES
Name: Transform-OctopusConfig
@rpresser
rpresser / gist:71b9ee973c946e21f4b3af653cb21cec
Last active Dec 19, 2019
Uniquify Names in a list of objects with a Name property, by appending _2, _3, etc.
View gist:71b9ee973c946e21f4b3af653cb21cec
class foo
{
public string Name { get; set; }
public string description { get; set; }
}
void Main()
{
List<foo> coll = new List<foo>();
coll.Add(new foo() { Name = "ross", description = "me" });
@rpresser
rpresser / gist:eb63b732932a2e9bcbdd0d7c8c7f9eca
Created Dec 18, 2019
Download OctopusDeploy artifacts from a task (C#)
View gist:eb63b732932a2e9bcbdd0d7c8c7f9eca
// This is C# code meant for use in LINQPad.
// Add nuget reference to Octopus.Client.
// Provide your OctopusDeploy server URL and APIKEY in environment variables (see the first line below),
// or hardcode them, or whatever you wish.
var endpoint = new OctopusServerEndpoint(Environment.GetEnvironmentVariable("OCTOPUS_SERVER"),Environment.GetEnvironmentVariable("OCTOPUS_CLI_API_KEY"));
var repository = new OctopusRepository(endpoint);
string taskID = "ServerTasks-104598";
var task = repository.Tasks.Get(taskID);