Skip to content

Instantly share code, notes, and snippets.

View jmarnold's full-sized avatar

Josh Arnold jmarnold

View GitHub Profile
@jmarnold
jmarnold / bottle-service.config
Created May 21, 2013 18:16
bottle-service.config
<?xml version="1.0" encoding="utf-8" ?>
<service>
<Name>MyService</Name>
<DisplayName>My First Bottle Service</DisplayName>
<Description>Does something cool</Description>
</service>
[TestFixture]
public class installation_plan_for_package_with_existing_dependencies_with_floating_updates
{
private InstallationPlan thePlan;
[SetUp]
public void SetUp()
{
thePlan = InstallationScenario.For("FubuMVC.Json", scenario =>
{
public class LinkInjector
{
private readonly IContainer _container;
public LinkInjector(IContainer container)
{
_container = container;
}
public void Inject(Type type, object model)
public class OurWindowsPrincipalHandler : IWindowsPrincipalHandler
{
private readonly ITransaction _transaction;
public OurWindowsPrincipalHandler(ITransaction transaction)
{
_transaction = transaction;
}
public bool Authenticated(IPrincipal principal)
public class CaseSnapshotFlattener : ICaseSnapshotFlattener
{
private readonly IProjectionRunner _runner;
public CaseSnapshotFlattener(IProjectionRunner runner)
{
_runner = runner;
}
public IDictionary<string, object> ToJson(CaseSnapshot model)
@jmarnold
jmarnold / validation-output.txt
Created February 15, 2013 20:49
PhantomJS support in Serenity
[13:24:05][Execute storyteller_ci] src/packages/Serenity.0.9.8.125/tools/SerenityRunner.exe storyteller src/FubuMVC.Validation.StoryTeller/validation.xml artifacts/Storyteller.html -b Phantom
[13:24:05][Execute storyteller_ci] Using browser Phantom
[13:24:05][Execute storyteller_ci] Writing results to C:\BuildAgent\work\df725bf3df5ceacf\artifacts\results
[13:24:05][Execute storyteller_ci] Loading Project at src/FubuMVC.Validation.StoryTeller/validation.xml
[13:24:05][Execute storyteller_ci] Running Project Validation
[13:24:11][Execute storyteller_ci] PhantomJS is launching GhostDriver...
[13:24:11][Execute storyteller_ci] Ghost Driver running on port 50577
[13:25:11][Execute storyteller_ci] Asynchronous Sessions cleanup phase starting NOW
[13:25:30][Execute storyteller_ci] =========================================================================================================
[13:25:30][Execute storyteller_ci] Acceptance Tests: 0 of 0 passed. 0 failed
@jmarnold
jmarnold / en-US.locale.config
Created February 6, 2013 20:13
Custom validation messages with the basic XML support.
<fubu-localization>
<string key="ValidationKeys:Required">{field} is a required field. This is a custom message</string>
</fubu-localization>
@jmarnold
jmarnold / IntegrationTestExample.cs
Created February 2, 2013 15:48
Sample integration testing
[TestFixture]
public class IntegrationTestExample
{
// You'll want the FubuMVC.Katana package for this
private EmbeddedFubuMvcServer theServer;
[SetUp]
public void SetUp()
{
theServer = new MyApplication().RunEmbedded();
@jmarnold
jmarnold / ajaxFormActivationPolicy.js
Created January 30, 2013 05:29
Conventional form activation
(function($, continuations) {
var activateFormsPolicy = {
matches: function(continuation) {
return continuation.isHtml() && continuation.options.activateForms;
},
execute: function (continuation) {
var element = continuation.options.element;
var content = $(continuation.response.responseText);
element.append(content);
@jmarnold
jmarnold / _global.spark
Last active December 11, 2015 06:48
Useful bindings
<use namespace="FubuCore" />
<use namespace="FubuMVC.Core.Assets" />
<use namespace="FubuMVC.Core.UI" />
<use namespace="System.Linq" />