Skip to content

Instantly share code, notes, and snippets.

View ChrisTowles's full-sized avatar

Chris Towles ChrisTowles

View GitHub Profile
@ChrisTowles
ChrisTowles / ActivityProfileDto.cs
Last active March 1, 2016 15:30
Azure Mobile Sync Model - Server
using Microsoft.Azure.Mobile.Server;
using Microsoft.Azure.Mobile.Server.Tables;
using System;
using System.ComponentModel.DataAnnotations.Schema;
namespace Ecrumbs.Models.DataObjects
{
public class ActivityProfileDto : ITableData
{
public string AccountId { get; set; }
@ChrisTowles
ChrisTowles / ActivityProfile.cs
Created March 1, 2016 15:29
Azure Mobile Sync Model - Client
using Microsoft.WindowsAzure.MobileServices;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Ecrumbs.Shared.Models
{
public class ActivityProfile
{
@ChrisTowles
ChrisTowles / AzureClientSyncModelBase.cs
Created March 7, 2016 14:57
Azure Mobile SDK Sync Base model for the client
using Microsoft.WindowsAzure.MobileServices;
using System;
namespace Ecrumbs.Shared.Models
{
public class AzureClientSyncModelBase
{
public AzureClientSyncModelBase()
{
Id = Guid.NewGuid().ToString();
@ChrisTowles
ChrisTowles / AzureServerSyncModelBase.cs
Created March 7, 2016 14:58
Azure Mobile SDK Base Model for Sync Entity
using Microsoft.Azure.Mobile.Server.Tables;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;
namespace Ecrumbs.Service.Data
{

Keybase proof

I hereby claim:

  • I am christowles on github.
  • I am ctowles (https://keybase.io/ctowles) on keybase.
  • I have a public key whose fingerprint is 8833 7251 27F7 A317 B286 F627 3A49 110C C9CE 1FD4

To claim this, I am signing this object:

@ChrisTowles
ChrisTowles / Create Self Signed Cert and Add to Trusted Root.ps1
Last active July 7, 2016 09:52
For Local Development, to Create a Self Signed Cert and then add it to the Trusted Root Certifcations.
#Note : NOT FOR PRODUCTION USE. Development boxes only.
Import-Module PKI
$tempPath = "C:\Temp"
$certPath = "$tempPath\SelfSignedCert.cer"
$dnsName = '*.somedomain.com'
#Create Temp Folder
@ChrisTowles
ChrisTowles / BakeMateralToTexture.cs
Created July 6, 2016 03:20
Updated Unity 5.3 Bake Material to Texture.
// This doesn't work or at least it didn't for the shader i was trying to use it with.
// Just Sharing Becasue i got farther with this than other version I found around the internet.
//
// Quit working on this because the shader i was trying to convert to a Standard Unity Shader
// Really could not be done as it was based reflections of orginal object (PolyWorld).
//orginal - http://wiki.unity3d.com/index.php/Bake_Material_to_Texture
using UnityEngine;
using UnityEditor;
@ChrisTowles
ChrisTowles / XSD Test.txt
Created July 6, 2016 12:07
Note to self on the C# Xsd to xml.
Notes for self on XSD to XML
http://stackoverflow.com/questions/6530424/generating-xml-file-using-xsd-file
Open "Developer Command Prompt" and Run the following commands to update the CS file.
d:
cd "D:\Code\TFS\.....\XSD Template"
@ChrisTowles
ChrisTowles / ExportAndImportCertToBase64.cs
Last active November 28, 2023 21:05
C# Import or Export Cert to Base64 String
public void ExportCertToBase64()
{
var certificate = new System.Security.Cryptography.X509Certificates.X509Certificate2("c:\\temp\\Signing Cert.pfx", "XXXXXXXXXXXXXX", X509KeyStorageFlags.Exportable);
StringBuilder builder = new StringBuilder();
builder.AppendLine("-----BEGIN CERTIFICATE-----");
builder.AppendLine(Convert.ToBase64String(certificate.Export(X509ContentType.Pkcs12, "XXXXXXXXXXXXXX"), Base64FormattingOptions.InsertLineBreaks));
builder.AppendLine("-----END CERTIFICATE-----");
@ChrisTowles
ChrisTowles / test-diagram
Created March 15, 2018 15:05
HTML Diagram with html
<h1>Braze Flows<h1>
<h2>Order Receipt Email</h2>
This is the scenario when an order is completed send them a personalized email
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-beta1/jquery.min.js"></script>
<script src="https://bramp.github.io/js-sequence-diagrams/js/webfont.js"></script>
<script src="https://bramp.github.io/js-sequence-diagrams/js/snap.svg-min.js"></script>
<script src="https://bramp.github.io/js-sequence-diagrams/js/underscore-min.js"></script>