Skip to content

Instantly share code, notes, and snippets.

View jeremysimmons's full-sized avatar

Jeremy Simmons jeremysimmons

View GitHub Profile
apiVersion: apps/v1
kind: Deployment
metadata:
name: azure-vote-back
spec:
replicas: 1
selector:
matchLabels:
app: azure-vote-back
template:
@jeremysimmons
jeremysimmons / VS Project GUIDS
Created January 7, 2019 22:30
visual studio project guids
https://www.codeproject.com/Reference/720512/List-of-Visual-Studio-Project-Type-GUIDs
ASP.NET 5 {8BB2217D-0F2D-49D1-97BC-3654ED321F3B}
ASP.NET MVC 1 {603C0E0B-DB56-11DC-BE95-000D561079B0}
ASP.NET MVC 2 {F85E285D-A4E0-4152-9332-AB1D724D3325}
ASP.NET MVC 3 {E53F8FEA-EAE0-44A6-8774-FFD645390401}
ASP.NET MVC 4 {E3E379DF-F4C6-4180-9B81-6769533ABE47}
ASP.NET MVC 5 {349C5851-65DF-11DA-9384-00065B846F21}
C# {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
C++ {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}
@jeremysimmons
jeremysimmons / scheduled_tasks.ps1
Created January 31, 2018 22:38
show the LastRunTime of scheduled task
<#
.Synopsis
Get the list of scheduled Tasks from Windows 7 or Windows 2008 computers
.Description
This script displays all the scheduled tasks available in a windows 7 or windows 2008 computer.
.Parameter ComputerName
Computer Name(s) from which you want to get the scheduled tasks information. If this
parameter is not used, the the script gets the scheduled tasks list from local computer.
@jeremysimmons
jeremysimmons / SelfCompile
Created January 30, 2018 15:23 — forked from plaurin/SelfCompile
Self Compiling LinqPad query
void Main()
{
Environment.CurrentDirectory = Path.GetDirectoryName(Util.CurrentQueryPath);
Compiler.CompileFiles(Options.CreateOnDiskDll(
@namespace: "LinqPad.QueriesCompiler",
outputFile: "LinqPad.QueriesCompiler.dll")
.AddCodeFile(CodeType.LinqProgramTypes, Util.CurrentQueryPath))
.Dump("Successfully created assembly at " + DateTime.Now.ToLocalTime());
}
@jeremysimmons
jeremysimmons / HtmlHelperPartialExtensions.cs
Last active June 7, 2017 19:17
Html.Partial for asp.net core mvc
public static class HtmlHelperPartialExtensions
{
public static IHtmlContent PartialWithPrefix(this IHtmlHelper htmlHelper, string partialViewName, object model, string prefix)
{
var htmlFieldPrefix = (string.Empty.Equals(prefix) ? "." : "") + prefix;
return htmlHelper.Partial(partialViewName, model, new ViewDataDictionary(htmlHelper.ViewData) { TemplateInfo = { HtmlFieldPrefix = htmlFieldPrefix } });
}
public static Task<IHtmlContent> PartialWithPrefixAsync(this IHtmlHelper htmlHelper, string partialViewName, object model, string prefix)
{
@jeremysimmons
jeremysimmons / build.proj
Created June 6, 2017 01:06 — forked from dasMulli/build.proj
Sample CI build definition using MSBuild
<Project>
<ItemGroup>
<Solution Include="*.sln" />
<PublishProject Include="XXX.Mvc\XXX.Mvc.csproj" />
<TestProject Include="**\*.Test*.*proj" Exclude="XXX.Tests.Shared\XXX.Tests.Shared.csproj" />
</ItemGroup>
<Target Name="Build">
<MSBuild Projects="@(Solution)" Targets="Restore" ContinueOnError="ErrorAndStop" UnloadProjectsOnCompletion="true" UseResultsCache="false" />
<MSBuild Projects="@(PublishProject)" Targets="Publish" Properties="Configuration=Release" ContinueOnError="ErrorAndContinue" />
@jeremysimmons
jeremysimmons / default boolean behavior
Created June 5, 2017 16:50
Conditional attribute rendering
@using System.Collections.Generic
@{
ViewData["Title"] = "Home Page";
var Colors = new List<string>
{
"thunderbird",
"mandarin",
"saffron",
"shamrock",
"aqua",
// plementation, here's a rendition of Server.HtmlDecode in Javascript
// HtmlDecode http://lab.msdn.microsoft.com/annotations/htmldecode.js
// client side version of the useful Server.HtmlDecode method
// takes one string (encoded) and returns another (decoded)
function HtmlDecode(s) {
var out = "";
if (s == null) return;
var l = s.length;
for (var i=0; i<l; i++) {
var ch = s.charAt(i);
void Main()
{
PointF center = new PointF(0f,0f);
for (int i = 1; i <= 12; i++)
{
PointF p = HourToLocation(i, center, 1f);
Console.WriteLine("{0}\t{1}\t{2:F3},{3:F3}", i, HourToAngle(i), Math.Round(p.X,3), Math.Round(p.Y,3));
}
}
void Main()
{
XunitRunner.Run(Assembly.GetExecutingAssembly());
}
// Define other methods and classes here
public class Class1
{
[Theory]