Skip to content

Instantly share code, notes, and snippets.

View jsheridanwells's full-sized avatar

Jeremy Wells jsheridanwells

View GitHub Profile
@jsheridanwells
jsheridanwells / 01.cs
Created June 18, 2020 16:38
weather-walking-skeleton-part_1
namespace WeatherWalkingSkeleton.Config
{
public class OpenWeather
{
public string ApiKey { get; set; }
}
}
using System;
using System.Net;
namespace WeatherWalkingSkeleton.Infrastructure
{
public class OpenWeatherException : Exception
{
public HttpStatusCode StatusCode { get; }
public OpenWeatherException() { }
@jsheridanwells
jsheridanwells / Dockerfile
Last active September 1, 2020 14:14
More or less the default Dockerfile that comes from the VS 2019 template
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
# See Also: https://docker-curriculum.com/#sf-food-trucks
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["AspNetCoreConfigExample.csproj", ""]
@jsheridanwells
jsheridanwells / docker-compose-mongo.yaml
Created February 19, 2021 15:28
Docker Compose for running MongoDB on localhost
version: "3"
services:
mongodb:
container_name: mean_urls_db
image: mongo:latest
volumes:
- ./scripts/mongo/init/:/docker-entrypoint-initdb.d
- ./scripts/mongo/init:/home/mongodb
- ./scripts/mongo/seed/:/home/mongodb/seed
- mean_urls_data:/data/db
@jsheridanwells
jsheridanwells / ng-conditional-content-projection-example.ts
Last active January 23, 2022 20:10
An example of Angular content projection. I was following this: https://angular.io/guide/content-projection#conditional-content-projection, but couldn't get it right away
import { Component, ContentChild, Directive, Input, OnInit, TemplateRef } from '@angular/core';
// parent component where the list is rendered and where we can decide where which conditional field will be rendered
@Component({
selector: 'app-root',
template: `
<h2>Here's where the chips come in yo</h2>
<div *ngFor="let c of config">
<app-chip [hasConditionalField]="c.hasConditionalField">
<ng-template appConditionalField>