Skip to content

Instantly share code, notes, and snippets.

@osmyn
osmyn / History\-10bb868f\entries.json
Last active January 13, 2023 17:46
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///d%3A/code/nw/northwell-gigya-tools/tests/readme.md","entries":[{"id":"kf9V.md","timestamp":1661780891576}]}
@osmyn
osmyn / coverage.runsettings
Created December 26, 2018 13:54
Example unit test runsettings file to exclude tests based on name, library, method, etc.
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Configurations that affect the Test Framework -->
<RunConfiguration>
<MaxCpuCount>1</MaxCpuCount>
<!-- Path relative to solution directory -->
<ResultsDirectory>.\TestResults</ResultsDirectory>
<!-- x86 or x64 -->
<!-- You can also change it from menu Test > Test Settings > Default Processor Architecture -->
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Async Unit Test</Title>
<Author>Rusty Divine</Author>
<Description>Async Unit Test Template with 3 Parts</Description>
<HelpUrl>https://msdn.microsoft.com/en-us/library/ms165394.aspx</HelpUrl>
<SnippetTypes />
<Keywords />
@osmyn
osmyn / AlexaRequest.cs
Created July 1, 2017 20:44
Alexa Skill Validators
using System;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace OneHundredCalories.Models
{
[JsonObject]
public class AlexaRequest
{
[JsonProperty("version")]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@osmyn
osmyn / recalc_table_shading.js
Created February 22, 2019 15:10
Recalculates a bootstrap table's row shading after rows hidden
$("tr:visible").each(function (index) {
$(this).css("background-color", !!(index & 1) ? "rgba(0,0,0,0)" : "rgba(0,0,0,.05)");
});

Home School Schedule

8:30 - Breakfast

9:30 - Learning Time (Reading, flashcards, green pack...)

10:30 - Movement Time (Go Noodle or yoga)

11:00 - Creative Activity (Coloring, painting, craft...)

@osmyn
osmyn / httpHelper.cs
Created March 6, 2018 21:43
HttpClient Non-Default Headers
var requestMessage = new HttpRequestMessage(HttpMethod.Get, "https://your.site.com");
requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", your_token);
httpClient.SendAsync(requestMessage);
@osmyn
osmyn / FileHelper.cs
Last active January 4, 2019 21:12
File utilities
using BusinessLogic.Utilities.Interfaces;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using BusinessLogic.Logging;
@osmyn
osmyn / include.cs
Created March 7, 2017 17:01
Mock .Include for EF
private void HelpSetupActivitiesFakes(
List<Activity> fakeActivity,
ActivityOutcome fakeOutcome,
List<ArgumentHierarchy> fakeHierarchy)
{
var mockedActivity = RepositoryTestingHelper
.GetMockDbSet<Activity>(fakeActivity.AsQueryable());
mockedActivity.Setup(x => x.Include("InputArgument"))
.Returns(mockedActivity.Object);