This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StateMachine<InputEvent,Data> sm = new StateMachine<InputEvent,Data>(); | |
sm.AddState("ONE", null) | |
.HandleEvent<InputOne>("ONE", (i, ctx, n) => { | |
Assert.AreEqual(1, i.Id); | |
Assert.AreEqual("ONE", n); | |
return n; | |
}, | |
"Message 1 1") | |
.HandleEvent<InputTwo>("TWO", (i, ctx, n) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class State<S, E> | |
{ | |
private readonly List<StateEntry<S,E>> entries; | |
public State() | |
{ | |
this.entries = new List<StateEntry<S,E>>(); | |
} | |
public StateEntry<S,E> When(Func<E, bool> selector) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stateMachine = require('./statemachine'); | |
var EventOne = function(event) | |
{ | |
return event == 'one'; | |
} | |
var EventTwo = function(event) | |
{ | |
return event == 'two'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_REST_, or Representational State Transfer is probably one of the most misunderstood terms in Web API development today. Where REST is misunderstood is that most people use REST as synonymous with anything that is easy to access over HTTP and forget about the constraints completely. | |
The term's roots are from Roy Fielding's previously mentioned dissertation on network based architecture (http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm). In it, Roy describes REST as an architectural style for distributed hypermedia systems. What he is saying is that REST is not a technology, it is not a framework, and it is not a design pattern. It is a style. There is no "One True Way" to do REST and as a result, many flavours of RESTful systems. What they have in common however, and most importantly, is that RESTful systems manifest iteself in a set of constraints: X, Y, Z. | |
The other part of the misunderstanding is that you MUST build a RESTful system. This is also not the case. The RESTful constrai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head></head> | |
<body> | |
<h1>Headless</h1> | |
<% include header %> | |
<br><br> | |
<h3>Sign In</h3> | |
<hr /> | |
<div class="signin"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using mOrders.Terminal.Infrastructure; | |
using mOrders.Terminal.Store; | |
namespace mOrders.Terminal.Services | |
{ | |
public class CPCLLabelFormatter | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Language="VBScript" %> | |
<script language="JScript" runat="server" src='json2.js'></script> | |
<% | |
CLIENT_ID = "PLACE YOUR AUTH0 CLIENTID HERE" | |
CLIENT_SECRET = "PLACE YOUR AUTH0 CLIENT SECRET HERE" | |
REDIRECT_URI = "http://localhost/Auth0ASP/callback.asp" | |
AUTHORIZATION_CODE = Request.querystring( "code" ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body{ | |
padding: 20px; | |
background: #f1f1f1; | |
} | |
h1,h2,h3{ | |
font-weight: 100; | |
} | |
.btn{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var crypto = require('crypto'); | |
var util = require('util'); | |
var request = require('request'); | |
var sbNamespace = '{YOUR NAMESPACE}'; | |
var sbEntityPath = '{YOUR QUEUE}'; | |
var sharedAccessKey = 'LBgdFoE........lFyvW4='; | |
var sharedAccessKeyName = '{POLICY NAME}'; | |
var sas = getSASToken(sbNamespace, sbEntityPath, sharedAccessKeyName, sharedAccessKey); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
wget -qO - https://gist.github.com/jfromaniello/1672b30342ee0eff5ee6/raw/update.sh > /root/update.sh | |
chmod +x /root/update.sh | |
wget -qO - https://gist.github.com/jfromaniello/1672b30342ee0eff5ee6/raw/update_config.sh > /root/update_config.sh | |
chmod +x /root/update_config.sh |
OlderNewer