Skip to content

Instantly share code, notes, and snippets.

View Red-Folder's full-sized avatar

Mark Taylor Red-Folder

View GitHub Profile
@Red-Folder
Red-Folder / payload.json
Created November 8, 2018 13:41
Sample JSON payload - used in my blog articles for creating a simple read model using AWS Api Gateway and S3
[
{
"id": "Sample-1",
"name": "Sample 1",
"description": "This is sample data #1"
},
{
"id": "Sample-2",
"name": "Sample 2",
"description": "This is sample data #2"
@Red-Folder
Red-Folder / create-read-model-api.json
Created November 8, 2018 13:40
AWS Cloud Formation template to create a simple read model using AWS Api Gateway & S3
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Produces the simple Read Model API. Includes S3 storage for static data, a user for accessing and an API",
"Parameters": {
"StackName": {
"Type": "String",
"Description": "Name to be used for the Stack and all associated items. Should be unique."
}
},
"Resources": {
@Red-Folder
Red-Folder / function.proj
Created November 3, 2018 17:33
Sample function.proj for a private/ custom nuget feed for Azure Functions V2
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RestoreSources>
https://www.myget.org/F/red-folder/api/v3/index.json;
https://api.nuget.org/v3/index.json;
</RestoreSources>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Red-Folder.WebCrawl.Data" Version="0.1.87"/>
@Red-Folder
Red-Folder / nuget.config
Last active July 29, 2023 15:42
Sample nuget.config to show how to add personal nuget server
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="NAME" value="FEEDURL" />
<add key="NuGet official package source" value="https://nuget.org/api/v2/" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
@Red-Folder
Red-Folder / IndexDocDB.cs
Last active September 13, 2016 20:55
Adding an index to a DocumentDB collection
DocumentClient client;
client = new DocumentClient(new Uri(endpointUri), primaryKey);
DocumentCollection resultCollection = client.ReadDocumentCollectionAsync(UriFactory.CreateDocumentCollectionUri(databaseName, collectionName)).Result;
resultCollection.Id = collectionName;
resultCollection.IndexingPolicy.IncludedPaths.Clear();
resultCollection.IndexingPolicy.IncludedPaths.Add(
new IncludedPath
{
Path = "/timestamp/?",
@Red-Folder
Red-Folder / gist:37ce29b60b54173e315b
Created February 11, 2016 15:05
Confluence WebSequenceDiagrams.com template
<div class=wsd wsd_style="napkin">
<pre>
$body
</pre>
</div>
<script type="text/javascript" src="http://www.websequencediagrams.com/service.js"></script>
@Red-Folder
Red-Folder / gist:a0a379b37654be83ca42
Created November 9, 2014 17:39
AWS config file to install MSSQL Module
commands:
01-install_mssql:
command: yum -y --enablerepo=amzn-updates install php-mssql
test: "php -r \"exit(extension_loaded('mssql') ? 1 : 0);\""
git add *
git commit -m "Commit message"
git push
build("BackgroundServicePlugin Prepare For Github", BUILDOUTPUTPATH: pluginpath)
build("BackgroundServicePlugin Source Prepare For Github", SOURCEPATH: sourcepath)
. "C:\JenkinsWorkspace\PSScripts\HelperScripts.ps1"
syncFolders $env:SOURCEPATH $env:workspace