Skip to content

Instantly share code, notes, and snippets.

Justin Yoo justinyoo

Block or report user

Report or block justinyoo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@justinyoo
justinyoo / fluent-validation.cs
Last active Oct 7, 2019
Many Meanings of Message Validation
View fluent-validation.cs
public class OrderItem
{
public string ItemId { get; set; }
public int Amount { get; set; }
}
public class OrderItemValidator : AbstractValidator<OrderItem>
{
public OrderItemValidator()
{
@justinyoo
justinyoo / azurite-install.sh
Last active Oct 15, 2019
Azure Storage Emulator on Azure Pipelines
View azurite-install.sh
# Install the latest preview
sudo npm install -g azurite
# Install the latest stable
sudo npm install -g azurite@2.7.1
@justinyoo
justinyoo / stages.yaml
Created Sep 22, 2019
Azure DevOps YAML Pipelines Approval Strategy
View stages.yaml
stages:
...
- stage: ReleaseWithoutTemplate
displayName: 'Release without Template'
...
jobs:
- deployment: HostedVs2017
...
environment: release
...
View csproj-package.xml
<Project Sdk="Microsoft.NET.Sdk">
...
<ItemGroup>
...
<!-- Reference the NuGet package -->
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
...
View sender-validation-plugin-1.cs
public class SenderValidationPlugin : ServiceBusPlugin
{
}
View microsoft-azure-servicebus-message.cs
// Sends message
var @object = new MyClass() { Hello = "World" };
var payload = JsonConvert.SerializeObject(@object);
var body = Encoding.UTF8.GetBytes(payload);
var message = new Message(body);
// Receives message
var body = message.Body;
var payload = Encoding.UTF8.GetString(body);
var @object = JsonConvert.DeserializeObject<MyClass>(payload);
@justinyoo
justinyoo / pipeline-build-with-jobs-template.yaml
Created Aug 24, 2019
Azure DevOps Pipelines Refactoring Technics
View pipeline-build-with-jobs-template.yaml
# pipeline.yaml
...
stages:
...
- stage: BuildWithJobsTemplate
displayName: 'Build with Jobs Template'
variables:
- name: Greeting
value: 'Hello World'
@justinyoo
justinyoo / actionable-message-card.json
Created Aug 18, 2019
Two Ways Building MS Teams Custom Connector with Logic Apps
View actionable-message-card.json
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"summary": "Website Published to Netlify",
"sections": [
{
"activityImage": "https://raw.githubusercontent.com/devkimchi/Microsoft-Teams-Channel-Notification/master/images/published.png",
"activityTitle": "Published: @{triggerBody()['name']}",
"activitySubtitle": "[@{triggerBody()['url']}](@{triggerBody()['url']})",
"activityText": "@{triggerBody()['published_at']}"
@justinyoo
justinyoo / filter-recipients.json
Created Aug 13, 2019
Enriching Mail Filtering Rules by Azure Logic Apps
View filter-recipients.json
"Filter_Recipients": {
"type": "Query",
"runAfter": {
"Get_All_Recipients": [
"Succeeded"
]
},
"inputs": {
"from": "@variables('FolderLookupReferences')",
"where": "@contains(outputs('Get_All_Recipients'), item()?.email)"
@justinyoo
justinyoo / e2e-test-build.yaml
Last active Sep 24, 2019
Azure Functions SRE, The First Cut
View e2e-test-build.yaml
# Release Pipeline
- stage: Release
jobs:
- deployment: HostedVs2017
...
variables:
- name: TestRunStatus
value: ''
strategy:
You can’t perform that action at this time.