Skip to content

Instantly share code, notes, and snippets.

View HowardvanRooijen's full-sized avatar

Howard van Rooijen HowardvanRooijen

View GitHub Profile
@HowardvanRooijen
HowardvanRooijen / gist:ffb7679e5d9ad89a6f0f
Created September 24, 2014 11:32
Jasmine MetaRunner
<?xml version="1.0" encoding="UTF-8"?>
<meta-runner name="Jasmine Specification Runner">
<description>Jasmine Specification Runner</description>
<settings>
<parameters>
<!-- Mandatory Fields -->
<param name="teamcity.tool.jasmine.jasmineversion" value="n/a" spec="select data_1='1.3' data_2='2.0' label_1='Jasmine v1.3' label_2='Jasmine v2.0' description='Select the version of Jasmine.' display='normal' label='Jasmine Version'" />
<param name="teamcity.tool.jasmine.specfile" value="" spec="text description='Spec file to execute' display='normal' label='Jasmine Spec File' validationMode='not_empty'" />
</parameters>
<build-runners>
@HowardvanRooijen
HowardvanRooijen / gist:ebbac1286222d23c3ffe
Last active April 10, 2019 19:48
Post Data into Azure Event Hubs using Web Api Client
private Task<HttpResponseMessage> PostTelemetryAsync(DeviceTelemetry deviceTelemetry)
{
// Use Event Hubs Signature Generator 0.2.0.1 to generate the token
// https://github.com/sandrinodimattia/RedDog/releases/tag/0.2.0.1
// http://fabriccontroller.net/blog/posts/iot-with-azure-service-bus-event-hubs-authenticating-and-sending-from-any-type-of-device-net-and-js-samples/
var sas = "SharedAccessSignature sr=YOUR TOKEN HERE";
// Namespace info.
var serviceNamespace = "YOUR NAMESPACE";
var hubName = "YOUR HUB NAME";
@HowardvanRooijen
HowardvanRooijen / gist:fe58e735f3a235e2662f
Created February 23, 2015 17:09
Sample Endjin.Licensing License File
<License>
<Id>dcc9b07f-88ba-4fdb-be7f-8ed73f3fd81f</Id>
<ExpirationDate>2015-02-28T23:59:59.0000000+00:00</ExpirationDate>
<IssueDate>2015-02-23T16:38:24.8555688+00:00</IssueDate>
<Type>Subscription</Type>
<LicensedCores>2</LicensedCores>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
@HowardvanRooijen
HowardvanRooijen / gist:b2ec342b95ec9ed94170
Created February 23, 2015 17:09
Sample Endjin.Licensing Public Key File
<RSAKeyValue>
<Modulus>lZHF2f9PuYZIfsKCXbUmfHM/JwT4UstHRzZ+EpQixbyaIajEBvA7v2ZdUykF72bTzOMA2CxA+C9yxqpjkG/G4DHcvovN2suvcsIOgnydkVSBzYg38bOohS1ycSMUUGX0ilyeQB2v+s52LJknaMKKnKA6sHDz9Y5H+vrJ2G+fe6qhl87wW+oKq8UvfEAevFbwOvljajoduhZQHJYNHZrKfQK29s1WoUMLafXMtofExj1PTIDHGt1nXre6UY9FSETy78D7S6wVc7j0jjM57PBgoalqfacrb/VB701wNhhUPUrzt+R7VtealVsxZB3cJo213oRJiz2/byfAueEKBWnMRR1UUm9Uuxa8kbvoRutKI2Fm/6UdcHlbxvJ4GM1sCz+ijz8/zwWFx9UQpgpqzyJ2YH9CENbIW7IPqoUqt029Us9JGmHNbyE8V/oIoccUfvFmmh2n+zD2GxkViBsM8fbGh+fl1i9y0cmL2EaM0yWV+AHADxANS58BfQk7IVj7XHxP9s2AlEgIKslm8V14ar+saocoAL2mBM9sUbucJ5v8KgTviUYsPFFKv+YpWiBSGG3EY6tGO3QUvv+dK+mibFMby92VbRm27FHlxCX9OXzDYkrTTKTF0vlhtsZiQYCNQSwzmxEZpjFV/lhfq/+zJBcuoruXEGleRl/rpesVJrwGHAc=</Modulus>
<Exponent>AQAB</Exponent>
</RSAKeyValue>
@HowardvanRooijen
HowardvanRooijen / gist:bea8f5449d7f23b93024
Created February 23, 2015 21:49
Initial specification for Endjin.Licensing
Feature: Create a License
In order to run vellum
As a user
I want to be able to obtain valid licenses for my runtime requirements
Scenario: Create a Vellum License for the Free Azure Website rate
Given I want a license for my Azure Website http://mysite.azurewebsites.net
And I have a staging slot configured at http://mysite-staging.azurewebsites.net
And I want to run on a free subscription
And my billing subscription commenced today
@HowardvanRooijen
HowardvanRooijen / gist:4026ee0a3b21666cca08
Created February 23, 2015 22:17
First Validate a License Scenario
Feature: Validate License
In order to allow users to only use my software with a valid license
As a software provider
I want to be able to validate the license based on its criteria
Scenario: Validate a 'Subscription' License that was issued today
Given they want a 'Subscription' license
And their license was issued today
And I generate their license
When they validate their license
@HowardvanRooijen
HowardvanRooijen / gist:1c493209e758a57e547c
Created February 23, 2015 22:18
Second Validate License Scenario
Scenario: Validate a 'Subscription' License that expired last month
Given they want a 'Subscription' license
And their license was issued a month ago
And I generate their license
When they validate their license
Then it should be an expired license
And it should have been issued last month
And the license should have expired on the last day of last month
@HowardvanRooijen
HowardvanRooijen / gist:21d491e01b4907cb197c
Last active August 29, 2015 14:16
Final Vellum Specification
Scenario: Free Azure Hosting Plan License that was issued today and is running on a Free Azure Hosting Plan License with a valid host name is valid
Given they want a 'Subscription' license
And their customer id is 'c8ca3109-6fbf-4b75-b6ee-67a1a0a56bd1'
And their subscription id is '03c1b02b-7806-4e94-8044-140d95ff52d1'
And their license was issued today
And their SKU is 'Free'
And their development host is 'localhost'
And their site name is 'mysite'
And they are running the site on a 'Free' Azure Hosting Plan
And they are hosting on a website called 'mysite'
@HowardvanRooijen
HowardvanRooijen / gist:95c0347e4cdea740ee36
Created February 25, 2015 22:57
First License Tampering Scenario
Scenario: Tamper with the expiration date of a license
Given the user is issued with a valid 'Subscription' license
And the user tampers with the expiration date of the license
When they validate their license
Then it should be an invalid license
@HowardvanRooijen
HowardvanRooijen / ILicenseValidationRule.cs
Created February 25, 2015 23:36
ILicenseValidationRule
public interface ILicenseValidationRule
{
void Validate(LicenseCriteria licenseCriteria);
}