Skip to content

Instantly share code, notes, and snippets.

View CalvinAllen's full-sized avatar

Calvin A. Allen CalvinAllen

  • 02:51 (UTC -04:00)
View GitHub Profile
@CalvinAllen
CalvinAllen / cwc-cla.md
Last active October 20, 2023 04:32
Coding with Calvin CLA

CODING WITH CALVIN, LLC.

INDIVIDUAL CONTRIBUTOR LICENSE AGREEMENT

Thank you for your interest in contributing to the open source projects of Coding with Calvin, LLC. (“Coding with Calvin”). In order to clarify the intellectual property license granted with Contributions from any person or entity, Coding with Calvin must have a Contributor License Agreement ("Agreement") on file that has been signed by each Contributor, indicating agreement to the license terms below. This Agreement is for your protection as a Contributor as well as the protection of Coding with Calvin; it does not change your rights to use your own Contributions for any other purpose.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Coding with Calvin. Except for the licenses granted herein to Coding with Calvin and recipients of software distributed by Coding with Calvin, You reserve all right, title, and interest in and to Your Contributions.

Definitions

@CalvinAllen
CalvinAllen / pre-commit
Created March 12, 2022 03:04 — forked from simonauner/pre-commit
Format c# with dotnet-format with pre-commit hook
#!/bin/sh
# Modified from https://gist.github.com/EtherZa/581d9276336353838b2c939f9554d479
#
# This script finds the files that are about to be committed,
# and runs dotnet format on them before adding them back to staging
#
# install dotnet-format: dotnet tool install -g dotnet-format
# make sure installed dotnet tools are on your path:
# export PATH="$PATH:$HOME/.dotnet/tools/"
# copy to .git/hooks/pre-commit and make executable
@CalvinAllen
CalvinAllen / Configuration.cs
Created February 16, 2022 22:14
Using ConfigurationBuilder
var configBuilder = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile($"appsettings.{environment}.json", optional: true);
if (environment == EnvironmentEnum.LocalDevelopment)
{
configBuilder.AddUserSecrets<Function>(optional: true);
}
configBuilder.AddEnvironmentVariables();
@CalvinAllen
CalvinAllen / script.sh
Created November 10, 2020 19:03 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>latest</LangVersion>
<AWSProjectType>Lambda</AWSProjectType>
<AssemblyName>bootstrap</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.CloudWatchLogsEvents" Version="2.0.0" />
name: EZRep Build
on:
push:
tags: releases/[1-9]+.[0-9]+.[0-9]+
branches: master
jobs:
build:
runs-on: windows-latest
@CalvinAllen
CalvinAllen / dotnet-framework-build-action.yml
Last active March 25, 2024 06:19
A GitHub Action to build a .NET Framework Web Application and Deploy it to Azure
name: EZRep Build
on:
push:
branches: master
jobs:
build:
runs-on: windows-latest
Starting: UseDotNet
==============================================================================
Task : Use .NET Core
Description : Acquires a specific version of the .NET Core SDK from the internet or the local cache and adds it to the PATH. Use this task to change the version of .NET Core used in subsequent tasks. Additionally provides proxy support.
Version : 2.164.0
Author : Microsoft Corporation
Help : https://aka.ms/AA4xgy0
==============================================================================
Tool to install: .NET Core sdk version 3.1.x.
Found version 3.1.102 in channel 3.1 for user specified version spec: 3.1.x
{% assign cover_image = page.path | prepend: '/' | prepend: site.source %}
{% capture cover_image_exists %}{% cover_exists {{ cover_image }} %}{% endcapture %}
{% if page.image and cover_image_exists == "true" %}
<meta property="og:image" content="{{ site.url }}{{ page.url }}{{ page.image }}" />
{% else %}
<meta property="og:image" content="{{ site.url }}/images/social/headshot.jpg" />
{% endif %}
{% assign cover_image = post.path | prepend: '/' | prepend: site.source %}
{% capture cover_image_exists %}{% cover_exists {{ cover_image }} %}{% endcapture %}
{% if post.image and cover_image_exists == "true" %}
<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="{{ site.url }}{{ post.url }}{{ post.image }}" />
{% else %}
<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="{{ site.url }}/images/social/headshot.jpg" />
{% endif %}