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
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
{
<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>
@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>
@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 / 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 / createBindings.js
Created August 8, 2011 14:07
Gists for knockout.unobtrusive post
ko.unobtrusive.createBindings(bindings);
ko.applyBindings(viewModel);
@bsatrom
bsatrom / raw.html
Created September 1, 2011 18:54
HTML5 Web Forms, ASP.NET MVC and MvcContrib
<fieldset>
<legend>Place Your Order</legend>
Name: <input type="text" class="field" id="orderName" required autofocus placeholder="ex. Hugo Reyes" />
Email: <input type="email" class="field" id="orderEmail" required placeholder="ex. name@domain.com" />
Website: <input type="url" class="field" id="orderWebsite" placeholder="ex. http://www.domain.com" />
Phone: <input type="tel" id="orderTelephone" class="field" pattern="\(\d\d\d\) \d\d\d\-\d\d\d\d" title="(xxx) xxx-xxxx" />
Requested Delivery Date: <input type="date" id="deliveryDate" class="field" required />
Shipping Address: <textarea rows="4" cols="20" id="orderShipping" class="field" required></textarea>
Quantity: <input type="number" id="orderQty" name="orderQty" min=1 max=10 step=1 value=1 />
<input type="submit" value="Place Order" />
@bsatrom
bsatrom / FluentHtml5ViewPage.cs
Created September 1, 2011 21:34
HTML5 Web Forms, ASP.NET MVC and MvcContrib
public class FluentHtml5ViewPage<T> : ModelViewPage<T> where T : class
{
public FluentHtml5ViewPage()
: base(new RegularExpressionBehavior(), new RangeBehavior(), new RequiredBehavior()){}
}
@bsatrom
bsatrom / createThubbarButtons.js
Created November 7, 2011 18:28
Pinify Update to support hidding thumbbar buttons by default
createThumbbarButtons: function (options) {
var defaultOptions;
if (!siteModeSupported()) {
return this;
}
defaultOptions = {
buttons: []
};
options = $.extend({}, defaultOptions, options);
return callWindowExternalSafely(function () {
@bsatrom
bsatrom / hook_stdout.coffee
Created November 8, 2011 21:56
Samples for hooking into STDOUT for unit testing in Node.js
exports = module.exports
exports.setup = (callback) ->
write = process.stdout.write
process.stdout.write = ((stub) ->
(string, encoding, fd) ->
stub.apply process.stdout, arguments
callback string, encoding, fd)(process.stdout.write)