Skip to content

Instantly share code, notes, and snippets.

View jmarnold's full-sized avatar

Josh Arnold jmarnold

View GitHub Profile
@jmarnold
jmarnold / sample.spark
Created May 24, 2012 04:39
clean bindings + localization
<script id="invite-email-template" type="text/html">
<nav id="mobileHeader">
<BackButton />
<h1>
<span>
<LabelText property="Header" />
</span>
</h1>
</nav>
<section class="container-fluid">
@jmarnold
jmarnold / registry.cs
Created May 22, 2012 19:12
Navigation Fun
public class OurNavigationRegistry : NavigationRegistry
{
public OurNavigationRegistry()
{
ForMenu(NavigationKeys.Main);
Add += MenuNode.ForAction<CurrentController>(NavigationKeys.Current, x => x.Index(null));
Add += MenuNode.ForAction<FutureController>(NavigationKeys.Future, x => x.get_futures(null));
Add += MenuNode.ForAction<HistoryController>(NavigationKeys.Historical, x => x.get_history_view(null));
Add += MenuNode.ForAction<ContactsController>(NavigationKeys.Contacts, x => x.get_contacts_list(null));
Add += MenuNode.ForAction<SettingsController>(NavigationKeys.Settings, x => x.Index(null));
@jmarnold
jmarnold / mobile.coffee
Created May 21, 2012 20:34
Simple screen stuff
class CurrentController
constructor: (timer, dataSource, screens) ->
@timer = timer
@dataSource = dataSource
@screens = screens
self = this
@timer.elapsed () -> self.updateSnapshot()
@timer.start()
[TestFixture]
public class showing_you_my_junk
{
private ISomething theSomethingA;
private ISomething theSomethingB;
private SomethingElse theClassUnderTest;
[SetUp]
public void SetUp()
{
@jmarnold
jmarnold / .gitignore
Created May 3, 2012 07:00
Ignore the diagnostics zip
src/MyProject/fubu-content/*
!src/MyProject/fubu-content/*.zip
@jmarnold
jmarnold / SampleProjection .cs
Created April 30, 2012 03:11
SampleProjection
public class SampleProjection : Projection<MyModel>
{
public SampleProjection()
: base(DisplayFormatting.UseDisplayFormatting)
{
// mapping properties here. the values are sent through IDisplayFormatter for all the conventional goodness
Value(x => x.BlockNr);
// Value... It's on our TODO list to do conventional mappings. It's all there just need to do it (e.g., IncludeImmediateProperties())
Value(x => x.LeadingTimestamp.Key).Name("Leading"); // when the name of the property doesn't sit well with you
public class TermsRedirectBehavior : BasicBehavior
{
private readonly IFubuRequest _request;
private readonly IUrlRegistry _urlRegistry;
private readonly IOutputWriter _outputWriter;
private readonly IPartialFactory _factory;
public TermsRedirectBehavior(IFubuRequest request, IUrlRegistry urlRegistry, IOutputWriter outputWriter, IPartialFactory factory)
: base(PartialBehavior.Executes)
{
@jmarnold
jmarnold / core.asset.config
Created March 4, 2012 05:40
Asset Configuration
example.js requires jquery.js
example.js requires example.coffee
@jmarnold
jmarnold / continuation.policies.js
Created February 18, 2012 05:10
jquery.continuations samples
(function() {
// Illustrates prototype extensions to the core continuation object
$.continuations.continuation.prototype.dialog = function () {
if (!this.success || typeof (this.form) === 'undefined') {
return $([]);
}
return this.form.parents('.ui-dialog-content');
};
@jmarnold
jmarnold / bindings.xml
Created February 15, 2012 03:47
Check out my sweet bindings
<bindings>
<element name="Stylesheet">#this.Asset('@href');</element>
<element name="Script">#this.Asset('@src');</element>
<element name="Scripts">this.WriteScriptTags()</element>
<element name="Styles">this.WriteCssTags()</element>
<element name="Image">this.ImageFor('@src')</element>
</bindings>