Skip to content

Instantly share code, notes, and snippets.

View jmarnold's full-sized avatar

Josh Arnold jmarnold

View GitHub Profile
<style>
[data-custom-class='body'], [data-custom-class='body'] * {
background: transparent !important;
}
[data-custom-class='title'], [data-custom-class='title'] * {
font-family: Arial !important;
font-size: 26px !important;
color: #000000 !important;
}
[data-custom-class='subtitle'], [data-custom-class='subtitle'] * {
# things.py
# Let's get this party started!
import falcon
# Falcon follows the REST architectural style, meaning (among
# other things) that you think in terms of resources and state
# transitions, which map to HTTP verbs.
class ThingsResource(object):
@jmarnold
jmarnold / sample.js
Created May 27, 2015 18:05
projection example
module.exports = {
matches: function(evt) {
return evt.type === 'workspace:updated';
},
dependencies: function(evt) {
return {
workspace: evt.data.workspaceId
};
},
execute: function(evt, context) {
@jmarnold
jmarnold / what_the_heck.cs
Created April 21, 2015 14:14
Can't find the behavior
[TestFixture]
public class what_the_heck
{
[Test]
public void debug()
{
AppStartFubuMVC.Start();
var route = RouteTable
.Routes
.OfType<Route>()
[{"ASIN":"031037281X","DetailPageURL":"http://www.amazon.com/The-Lost-Art-Disciple-Making/dp/031037281X%3FSubscriptionId%3DAKIAJPOJCN6FAVPYCFNA%26tag%3Djossboo05-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D031037281X","ItemLinks":{"ItemLink":[{"Description":"Technical Details","URL":"http://www.amazon.com/The-Lost-Art-Disciple-Making/dp/tech-data/031037281X%3FSubscriptionId%3DAKIAJPOJCN6FAVPYCFNA%26tag%3Djossboo05-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D031037281X"},{"Description":"Add To Baby Registry","URL":"http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3D031037281X%26SubscriptionId%3DAKIAJPOJCN6FAVPYCFNA%26tag%3Djossboo05-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D031037281X"},{"Description":"Add To Wedding Registry","URL":"http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3D031037281X%26SubscriptionId%3DAKIAJPOJCN6FAVPYCFNA%26tag%3Djossboo05-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D38
@jmarnold
jmarnold / request.txt
Last active August 29, 2015 13:57
User Media Request
POST https://test.api.faithlife.com/community/v1/usermedia/uploads HTTP/1.1
x-logos-auth-version: 1.0
Content-Type: image/jpeg
Host: test.api.faithlife.com
Content-Length: 667824
Expect: 100-continue
Accept-Encoding: gzip, deflate
...
@jmarnold
jmarnold / EventStoreExample.cs
Created March 24, 2014 03:57
Appending to streams
class Program
{
static void Main(string[] args)
{
var settings = ConnectionSettings.Create()
.EnableVerboseLogging()
.UseCustomLogger(ClientApiLoggerBridge.Default)
.LimitReconnectionsTo(1)
.WithConnectionTimeoutOf(TimeSpan.FromSeconds(10))
.SetReconnectionDelayTo(TimeSpan.FromMilliseconds(0))
@jmarnold
jmarnold / ActionLessBehaviors.cs
Created December 18, 2013 15:51
Actionless behaviors
var graph = BehaviorGraph.BuildFrom<MyRegistry>();
var chain = graph.BehaviorFor(typeof(MyViewModel));
@jmarnold
jmarnold / MyScenarios.cs
Created December 4, 2013 04:49
Sample scenario configuration
public class MyScenarios : IFubuRegistryExtension
{
public void Configure(FubuRegistry registry)
{
registry.AlterSettings<ScenarioFilesSettings>(scenarios => scenarios.IncludeProvenance(typeof(OneExchangeSystem).Namespace));
// Just an *optional* hook that gets invoked whenever a scenario is successfully run
// In our most recent usage, we forced a logout
registry.Services(x => x.ReplaceService<IStoryTellerHandler, OurStoryTellerHandler>());
@jmarnold
jmarnold / JObjectValues.cs
Created October 17, 2013 16:56
Improved JObjectValues
public class JObjectValues : IValueSource
{
private readonly JObject _jObject;
public JObjectValues(string json)
: this(JObject.Parse(json))
{
}
public JObjectValues(JObject jObject)