This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
demopi: | |
image: fritzregistry.azurecr.io/fritz.demopi:latest | |
volumes: | |
- type: bind | |
- source: /home/jfritz/demopo/ClickCount.csv | |
- target: /app/ClickCount.csv | |
ports: | |
- "80:8080" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-preview-alpine AS build | |
ARG TARGETARCH | |
WORKDIR /source | |
# copy csproj and restore as distinct layers | |
COPY Fritz.DemoPi/*.csproj . | |
RUN dotnet restore -a $TARGETARCH | |
# copy everything else and build app | |
COPY Fritz.DemoPi/. . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
watchtower: | |
image: containrrr/watchtower:armhf-latest | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- /jfritz/.docker/config.json:/config.json | |
command: ["--interval", "30", "--cleanup"] | |
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.UseStaticFiles(new StaticFileOptions() | |
{ | |
OnPrepareResponse = | |
r => { | |
string path = r.File.PhysicalPath; | |
if (path.EndsWith(".css") || path.EndsWith(".js") || | |
path.EndsWith(".gif") || path.EndsWith(".jpg") || | |
path.EndsWith(".png") || path.EndsWith(".svg") || path.EndsWith(".webp")) | |
{ | |
TimeSpan maxAge = new TimeSpan(370, 0, 0, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
builder.Services.AddWebOptimizer(pipeline => { | |
pipeline.AddCssBundle("/css/bundle.css", new NUglify.Css.CssSettings | |
{ | |
CommentMode = NUglify.Css.CssComment.None, | |
}, "app.css", "css/bootstrap.css", "style.css", | |
"css/plugins.css", "css/colors.css", "css/responsive.css"); | |
pipeline.MinifyJsFiles("/js/jqueryCustom.js"); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2>Recent Lessons</h2> | |
<PagingPostCollection | |
Posts="Posts" PageSize="6" | |
@rendermode="InteractiveWebAssembly" | |
SortAscending="false" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PostRepository | |
{ | |
public PostRepository(IWebHostEnvironment env, IMemoryCache cache) | |
{ | |
Env = env; | |
_Cache = cache; | |
} | |
public IHostEnvironment Env { get; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@page "/About" | |
@attribute [OutputCache(Duration = 600)] | |
<PageTitle>C# in the Cards - About Us</PageTitle> | |
<HeadContent> | |
<link rel="canonical" href="https://csharpinthecards.com/about" /> | |
<meta name="title" content="C# in the Cards - About Us"> | |
<meta name="description" content="C# in the Cards is an innovative video training series that teaches the fundamentals of C# programming language using a deck of cards. Join Microsoft instructor and Twitch streamer Jeff Fritz on this exciting journey."> | |
<meta name="keywords" content="C#, Programming, Learning, Video Series, Jeff Fritz, Microsoft, Twitch, Education, Coding, Deck of Cards, Interactive Learning"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IndexChannels { | |
public async Task Execute() { | |
var client = new ElasticClient("ID", new ApiKeyAuthenticationCredentials("API KEY")); | |
CreateChannelIndex(client); | |
await MigrateChannelsFromSqlServer(client); |
NewerOlder