Skip to content

Instantly share code, notes, and snippets.

View bsatrom's full-sized avatar
🏠
Working from home

Brandon Satrom bsatrom

🏠
Working from home
View GitHub Profile
@bsatrom
bsatrom / createBindings.js
Created August 8, 2011 14:07
Gists for knockout.unobtrusive post
ko.unobtrusive.createBindings(bindings);
ko.applyBindings(viewModel);
@bsatrom
bsatrom / MVCandUnobtrusive.html
Created July 27, 2011 18:37
KnockoutJS and ASP.NET MVC strongly-typed helpers
<fieldset>
<legend>Speaker Info</legend>
Name: @Html.TextBoxFor(m => m.Name) <br />
Bio: @Html.TextAreaFor(m => m.Bio) <br />
Twitter Handle: @Html.TextBoxFor(m => m.TwitterHandle) <br />
State: @Html.TextBoxFor(m => m.State) <br />
</fieldset>
@bsatrom
bsatrom / addSpeaker-brief.html
Created July 1, 2011 20:07
Moving from markup-based KnockoutJS bindings to unobtrusive bindings (After)
<form id="addSpeaker">
<fieldset>
<legend>Speaker Info</legend>
Name: <input type="text" id="name" /> <br />
Bio: <textarea id="bio"></textarea> <br />
Twitter Handle: <input type="text" id="twitterHandle" /> <br />
State: <input type="text" id="state" /> <br />
Photo Url: <input type="text" id="photoUrl" />
</fieldset>
<fieldset>
@bsatrom
bsatrom / addSpeaker-brief.html
Created June 30, 2011 22:06
Moving from markup-based KnockoutJS bindings to unobtrusive bindings (Before)
<form data-bind="submit: addSpeaker">
<fieldset>
<legend>Speaker Info</legend>
Name: <input type="text" data-bind="value: name" /> <br />
Bio: <textarea data-bind="value: bio"></textarea> <br />
Twitter Handle: <input type="text" data-bind="value: twitterHandle" /> <br />
State: <input type="text" data-bind="value: state" /> <br />
</fieldset>
<fieldset>
<legend>Languages</legend>
<Action Name="Send an SMS Text Message"
ClassName="MyCompany.Workflow.Messaging.Activities.SendSMSActivity"
Assembly="MyCompany.Workflow.Messaging.Activities, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=fe2315b70tbc147c"
AppliesTo="all"
Category="Messaging Actions">
<RuleDesigner Sentence="Send %1 to number %2">
<FieldBind Field="Message" Text="this message" DesignerType="TextBox" Id="1"/>
<FieldBind Field="Number" Text="this number" DesignerType="TextBox" Id="2"/>
</RuleDesigner>
using System;
using System.ComponentModel;
using System.IO;
using System.Net;
using System.Text;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
namespace MyCompany.Workflow.Messaging.Activities
{
<sources>
<source name="System.Workflow">
<listeners>
<add name="System.Workflow" />
</listeners>
</source>
<source name="System.Workflow.Runtime">
<listeners>
<add name="System.Workflow" />
</listeners>
<system.diagnostics>
<switches>
<add name="System.Workflow LogToTraceListeners" value="1" />
<add name="System.Workflow.Runtime" value="Error"/>
<add name="System.Workflow.Runtime.Hosting" value="Error"/>
<add name="System.Workflow.Runtime.Tracking" value="Error"/>
<add name="System.Workflow.Activities" value="Error"/>
<add name="System.Workflow.Activities.Rules" value="Off"/>
</switches>
<trace autoflush="true">
<configuration>
<system.diagnostics>
<switches>
<add name="System.Workflow LogToTraceListeners" value="1" />
<add name="System.Workflow.Runtime.Hosting" value="Verbose" />
<add name="System.Workflow.Runtime" value="Verbose" />
<add name="System.Workflow.Runtime.Tracking" value="Verbose" />
<add name="System.Workflow.Activities" value="Verbose" />
<add name="System.Workflow.Activities.Rules" value="Verbose" />
</switches>
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}