Skip to content

Instantly share code, notes, and snippets.

View beyond-code-github's full-sized avatar

Pete Smith beyond-code-github

View GitHub Profile
@beyond-code-github
beyond-code-github / teacherconfig.cs
Last active August 29, 2015 14:27
Example of teaher list config run amok
var teacherListConfig = new ListConfig()
{
ListTitle = "List of Teachers",
PostUrl = "api/teachers",
GetUrl = "api/teachers",
RequiresBulkUpload = true,
AllowSave = true,
ReadOnlyUnlessAdmin = false,
PageSize = 50,
ValidateNames = true,
@beyond-code-github
beyond-code-github / list-2.html
Created August 19, 2015 06:29
Generic list markup including added feature with toggle logic
<h1>@Model.ListTitle</h1>
<form action="@Model.PostUrl">
<input type="text" id="name" />
<input type="text" id="notes" />
<input type="submit" id="addButton" value="Add" />
</form>
@if (Model.RequiresBulkUpload) {
<form id="bulkUpload">
@beyond-code-github
beyond-code-github / list.html
Created August 12, 2015 06:59
Generic list markup
<h1>@Model.ListTitle</h1>
<form action="@Model.PostUrl">
<input type="text" id="name" />
<input type="text" id="notes" />
<input type="submit" id="addNewButton" value="Add" />
</form>
<table id="dataTableTarget">
</table>
@beyond-code-github
beyond-code-github / StudentList.html
Last active August 29, 2015 14:27
Students list markup
<h1>List of students</h1>
<form action="api/students">
<input type="text" id="name" />
<input type="text" id="notes" />
<input type="submit" id="addNewButton" />
</form>
<table id="dataTableTarget">
</table>
@beyond-code-github
beyond-code-github / TeacherList.html
Last active August 29, 2015 14:27
Teachers list markup
<h1>List of teachers</h1>
<form action="api/teachers">
<input type="text" id="name" />
<input type="text" id="notes" />
<input type="submit" id="addNewButton" />
</form>
<table id="dataTableTarget">
</table>
@beyond-code-github
beyond-code-github / details.md
Last active August 29, 2015 14:22
Workshop - Lifestyles of the rich and frameworkless

Workshop - Lifestyles of the rich and frameworkless

Level: Intermediate

Tags: Javascript, Single page applications, HTML5, Webcomponents, Databinding, Routing, Dependency Injection

Abstract

Angular, Ember, Meteor, Backbone, the front-end framework space is a busy place indeed. You'd be forgiven for feeling a bit overwhelmed and unsure where to start, but more importantly you're likely to miss an important alternative: to ditch your frameworks altogether and go it alone. It's not for everyone, but this approach can be valuable and rewarding - not just for you but for your clients as well.

Pete is a software consultant and speaker based near London with almost 10 years of experience making web applications with ASP.net, specialising in API design and JavaScript browser-based applications. He's also a keen distributed systems enthusiast who enjoys helping clients solve their cloud-scale problems.

He is the author of Superscribe - an open source routing framework - and HTTP query library Linq to Querystring among others. Just recently he's embarked on a journey learning JVM and Scala, with a little Python thrown in to boot.

Pete is a software consultant, speaker & writer living near London, UK. With over 10 years of experience making web applications, he started off with C# and Javascript and nowadays likes to build distributed systems in Scala.

He enjoys running training courses and speaking at conferences. Sometimes he works on OSS, and one time he even finished something. He believes a microservice should be twice as large as half it's height.

@beyond-code-github
beyond-code-github / pipelining.fs
Last active August 29, 2015 14:11
Example of custom OWIN pipelines based on routing with Superscribe in F#
type RequireHttps(next: AppFunc) =
member this.Invoke(environment: IDictionary<string, obj>) : Task =
match environment.["owin.RequestScheme"].ToString() with
| "https" -> (next.Invoke(environment))
| other ->
environment.["owin.ResponseStatusCode"] <- 400 :> obj
environment.["owin.ResponseReasonPhrase"] <- "Connection was not secure" :> obj
Task.FromResult<obj>(null) :> Task
type RequireAuthentication(next: AppFunc) =
@beyond-code-github
beyond-code-github / composition.fs
Last active August 29, 2015 14:11
Example of composition with Superscribe in F#
type NameBeginningWith(letter) as this =
inherit GraphNode()
do
this.ActivationFunction <- fun data segment -> segment.StartsWith(letter)
this.ActionFunctions.Add(
"set_param_Name",
fun data segment -> data.Parameters?Add("Name", segment));
type Startup() =
@beyond-code-github
beyond-code-github / 1-packages.xml
Last active August 29, 2015 14:11
Hello world in Superscribe - F# style
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Owin" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.Owin.Host.HttpListener" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.0" targetFramework="net45" />
<package id="Microsoft.Owin.Hosting" version="3.0.0" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />
<package id="Superscribe" version="0.4.4.15" targetFramework="net45" />
<package id="Superscribe.Owin" version="0.4.3.14" targetFramework="net45" />
</packages>