Skip to content

Instantly share code, notes, and snippets.

therightstuff therightstuff

Block or report user

Report or block therightstuff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@therightstuff
therightstuff / MigrationsList.json
Last active Sep 11, 2019
How to code Entity Framework programmable migrations
View MigrationsList.json
[
"201704230706451_AutomaticMigration",
"201704230705538_AutomaticMigration"
]
@therightstuff
therightstuff / keybase.md
Created Mar 3, 2019
keybase proof of identity
View keybase.md

Keybase proof

I hereby claim:

  • I am therightstuff on github.
  • I am therightstuff (https://keybase.io/therightstuff) on keybase.
  • I have a public key ASDOnjEkmg8wYq0rWQpvUcp4uItnJCBTX_5EBOrm7FcPjAo

To claim this, I am signing this object:

@therightstuff
therightstuff / AES.cs
Created Feb 10, 2019
Simple AES 256 CBC Encryption to and Decryption from Base64 encoded strings in C#
View AES.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace MyProject.Data.Encryption
{
@therightstuff
therightstuff / inheritance.js
Created Sep 11, 2018
simple node.js inheritance example
View inheritance.js
var util = require("util");
// simple class
function A() {
this.self= this;
this.className = "classA";
this.myVar = "ownerA";
}
// class methods
@therightstuff
therightstuff / exampleWorker.js
Created May 11, 2018
Web Worker callback design pattern
View exampleWorker.js
// ensure window object available
var window = self;
self.addEventListener('message', function (e) {
var payload = e.data;
var result = null;
var err = null;
switch (payload.cmd) {
case 'sampleCommand':
@therightstuff
therightstuff / BasicKeyVaultAuthentication.cs
Last active Aug 22, 2019
C# Azure Key Vault authentication using a service principal secret
View BasicKeyVaultAuthentication.cs
// SEE http://www.industrialcuriosity.com/2018/03/azure-key-vault-in-c-for-dummies.html FOR FULL EXPLANATION
/// <summary>
/// Gets the access token
/// The parameters will be provided automatically, you don't need to understand them
/// </summary>
/// <param name="authority"> Authority </param>
/// <param name="resource"> Resource </param>
/// <param name="scope"> scope </param>
/// <returns> token </returns>
@therightstuff
therightstuff / restify_with_cors.js
Last active Feb 12, 2018
CORS middleware for restify
View restify_with_cors.js
// MIDDLEWARE
// must be defined before routing configured
server.use(restify.plugins.bodyParser());
server.use(restify.plugins.queryParser());
// CORS must be first
var allowedMethods = [
"OPTIONS",
@therightstuff
therightstuff / Program.cs
Created Nov 19, 2017
‘How to create an Azure SQL Database programmatically’ with less frustration
View Program.cs
/****************************** Module Header ******************************\
* DOWNLOADED FROM https://code.msdn.microsoft.com/How-to-create-an-Azure-SQL-dbd0bf6a
* Modified By: Adam Fisher (https://github.com/therightstuff)
* Module Name: Program.cs
* Project: CSCreateAzureSQL
* Copyright (c) Microsoft Corporation.
*
* This sample will show how to create a SQL database on Microsoft Azure
* using C#
*
@therightstuff
therightstuff / JSON-CSV.html
Last active Feb 21, 2019
Online JSON / CSV Converter
View JSON-CSV.html
<html>
<head>
<title>Online JSON / CSV Converter</title>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://fastcdn.org/FileSaver.js/1.1.20151003/FileSaver.js"></script>
<script language="javascript">
var conversionStyle;
var prefixConnector;
var delimiter, delimiterCharacter;
@therightstuff
therightstuff / RSA.cs
Created Oct 4, 2017
Simple RSA Encryption to and Decryption from Base64 encoded strings in C#
View RSA.cs
using System;
using System.Security.Cryptography;
using System.Text;
namespace MyProject.Data.Encryption
{
public class RSA
{
public const bool OAEP_PADDING = true;
/// <summary>
You can’t perform that action at this time.