Skip to content

Instantly share code, notes, and snippets.

View carlcom's full-sized avatar

Carl Cook carlcom

  • Huntington Beach CA
View GitHub Profile
@carlcom
carlcom / dntController.cs
Last active September 19, 2018 22:15
ASP.NET Core 2 controller returns root/.well-known/dnt file with ContentType = "application/tracking-status+json"
using Microsoft.AspNetCore.Mvc;
using Hover.Models;
namespace Hover.Controllers
{
[Route(".well-known/[controller]")]
public class DntController : ControllerBase
{
private Settings Settings { get; set; }
public DntController(Microsoft.Extensions.Options.IOptions<Settings> settings)
@carlcom
carlcom / my_page.html
Created July 25, 2018 18:05
Easy way for children or anyone to start learning HTML and javascript. Nothing to install, just save and open with browser. Shows Google's doodle image
<!doctype html>
<html>
<head>
<title> Hi *you*! </title>
<meta name="author" content="Carl Cook">
<!-- Scratching the surface, just a starting point -->
</head>
<body>
<h2><span id="salutation">Hi</span> *you*!</h2>
<!-- colors with # and 3 or 6 digits (hexadecimal 0123456789abcdef) are RGB, Red Green and Blue, so try some combinations -->
@carlcom
carlcom / xDoc.sql
Created July 27, 2015 14:10
Simplify debugging. End errors when you need to pass a new input to a stored procedure and the Sproc might not be updated yet
CREATE PROCEDURE [dbo].[mySproc]
@xDoc XML
AS
/********************************************************************************************************
Created by: Carl Cook
Purpose: Show how to use a single XML input. Simplify debugging: no more copying many input values from
your source to SSMS to exec the Sproc. A new input (in @xDoc) will be ignored, not cause a run time
error, if the Sproc has not been updated. No SQL injection issues as @xDoc is converted to SQL params.
Mix @xDoc with other inputs if wanted.
@carlcom
carlcom / nice_mssql_email.sql
Created July 23, 2015 15:00
mssql procedure emails a formatted table
/*************************************************************************************************
Created On 7/23/2015
Created By CCook
Description: Email ...
Modified by Date Reason for Modification
------------- ---------- ----------------------------------------