Skip to content

Instantly share code, notes, and snippets.

Run terraform plan -input=false -out=$PLAN | sed -r 's/([[:space:]~+-]*).*(password|secret|key).*/\1****************/gi'
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
****************
****************
****************
****************
module.auth0.auth0_client.dacp_frontend: Refreshing state... [id=Qvsk4nxqQ9O8qmyWqiosq52IwC9O4FNj]
@amogram
amogram / Dockerfile
Created April 5, 2018 20:49
DockerFile for OpenFaas .NET Core functions on Kubernetes Raspberry Pi/ARM Deployments
FROM microsoft/dotnet:2.0-sdk as builder
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
# Optimize for Docker builder caching by adding projects first.
RUN mkdir -p /root/src/function
WORKDIR /root/src/function
COPY ./function/Function.csproj .
@amogram
amogram / apiclientwrapper.ts
Created May 24, 2017 15:41
API Client Wrapper
import {Injectable} from '@angular/core';
import {Http, Headers} from '@angular/http';
@Injectable()
export class WebServiceClient {
constructor(private http: Http) { }
// Creates an Authorization Header
createAuthHeader(headers: Headers) {
headers.append('Authorization', 'Basic');
@amogram
amogram / build.cake
Created April 25, 2017 16:17
Quick Cake Build Script for NMockaroo.
#tool nuget:?package=NUnit.ConsoleRunner&version=3.4.0
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////
// Define directories.
@amogram
amogram / umbraco.gitignore
Created November 16, 2016 10:12
A .gitignore file for Umbraco projects
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
@amogram
amogram / createtable.sql
Created November 8, 2016 14:01
IIS Log Table Starting Point
USE [ServerFileLogs]
GO
/****** Object: Table [dbo].[TempLogs] Script Date: 08/11/2016 14:01:07 ******/
DROP TABLE [dbo].[TempLogs]
GO
/****** Object: Table [dbo].[TempLogs] Script Date: 08/11/2016 14:01:07 ******/
SET ANSI_NULLS ON
GO
$ErrorActionPreference = "Stop"
function ImportLogFiles([string] $httpLogPath)
{
If ([string]::IsNullOrEmpty($httpLogPath) -eq $true)
{
Throw "The log path must be specified."
}
[string] $logParser = "${env:ProgramFiles(x86)}" `
@amogram
amogram / DateTimeHelpers.cs
Last active September 8, 2016 14:42
Gets the date for the next day. If it's today, return today.
using System;
namespace Common.DateTimeHelpers
{
public static class DateTimeHelpers
{
/// <summary>
/// Gets the date of the next specified day. If it's today, return today.
/// </summary>
/// <param name="from">The date</param>
@amogram
amogram / UmbracoTags.cshtml
Last active May 9, 2018 12:25
Using Umbraco Tags in a view
@if (@Model.Content.GetPropertyValue("tags") != null)
{
var tags = Model.Content.GetPropertyValue("tags").TryConvertTo<string>();
string[] tagArray = { };
if (tags.Success)
{
tagArray = tags.Result.Split(',');
}
if (tagArray.Any())
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using ExcelImporter.Util.XmlModel;
using OfficeOpenXml;
using OfficeOpenXml.Table;
namespace ExcelImporter.Util.ExcelReader
{