Skip to content

Instantly share code, notes, and snippets.

@hgirish
hgirish / nginx.conf.template
Created March 16, 2026 19:19
nginx.conf.template with HTTPS redirects + Cache‑Control
# Force HTTPS using Azure's X-Forwarded-Proto header
server {
listen 80;
# Redirect HTTP → HTTPS
if ($http_x_forwarded_proto = "http") {
return 301 https://$host$request_uri;
}
# Alias domains → primary domain (HTTPS)
#!/bin/sh
set -e
# Substitute environment variables into nginx.conf
envsubst '${PRIMARY_DOMAIN} ${ALIAS_DOMAINS}' \
< /etc/nginx/conf.d/nginx.conf.template \
> /etc/nginx/conf.d/default.conf
nginx -g "daemon off;"
FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
# Copy template and entrypoint
COPY nginx.conf.template /etc/nginx/conf.d/nginx.conf.template
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
@hgirish
hgirish / nginx.conf.template
Created March 16, 2026 19:11
Azure‑compatible HTTPS‑redirect configuration
# Force HTTPS using Azure's X-Forwarded-Proto header
server {
listen 80;
# Redirect HTTP → HTTPS
if ($http_x_forwarded_proto = "http") {
return 301 https://$host$request_uri;
}
# Alias domains → primary domain (HTTPS)
dotnet ef dbcontext scaffold "Server=localhost;Initial Catalog=Northwind;Trusted_Connection=True;MultipleActiveResultSets=true;Integrated Security = true;TrustServerCertificate=true;" Microsoft.EntityFrameworkCore.SqlServer --namespace Northwind.EntityModels --data-annotations
@hgirish
hgirish / gist:892f46b027e975386b5cbd4657f5bf1f
Created August 30, 2024 18:01
filter bad date string in M language in Power BI or PowerQuery
# Changed Type1 is previous transformation name
# FilteredDate is new column added
# [Date] is name of column containing dates in text format
= Table.AddColumn(#"Changed Type1", "FilteredDate", each try Value.Is(Date.From([Date]), type date) otherwise false )
@hgirish
hgirish / ssis-blank-date-cast-to-dt-date
Created August 18, 2024 07:08
SSIS import date in string to DB date when date is blank using Derived Column Task
# expression for date column in Derived Column Task
TRIM(DateUpdatedstring) == "" ? NULL(DT_DATE) : (DT_DATE)DateUpdatedstring
<style>
@media screen {
#printSection {
display: none;
}
}
@media print {
body * {
visibility: hidden;
}
# default SHA256
(Get-FileHash -Path filepath).Hash -eq "SHA256Hash"
# MD5 Hash
(Get-FileHash -Path filepath -Algorithm MD5).Hash -eq "MD5hash"
# SHA512 Hash
(Get-FileHash -Path filepath -Algorithm MD5).Hash -eq "SHA512hash"
@hgirish
hgirish / html-input-text-inside-td.html
Created March 24, 2023 01:15
input text inside table td aligning with header row
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Table input</title>
<style>
table {
width: 100%;