This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to your psake scripts to deploy NServiceBus endpoints and start the service. | |
function global:deploy_endpoint($name) { | |
$project = "$BaseDir\src\$name\$name.csproj" | |
$buildPath = "$DeployBaseDir\$name" | |
# The DataBus is at c:\NServiceBus_DataBus, so this naming makes things easy to see in Windows Explorer | |
$deployPath = "c:\NServiceBus_Endpoints\$name" | |
exec { msbuild $project "/p:Configuration=$Config;OutputPath=$buildPath" "/t:Build" } | |
if (Test-Path $buildPath\packages.config) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myFunction(someObject, the, arguments) { | |
}; | |
// with tap | |
$('selector') | |
.tap(myFunction, the, arguments) | |
.hide(); | |
// without tap | |
var $collection = $('selector') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST file to /songs: | |
{ | |
id: UUID, | |
bytes: byte[], | |
title: // blah blah | |
} | |
express method handle POST request: | |
put the POST data in the transcoding message queue with message type "encodeSong" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Handlebars.registerHelper('json', function(obj) { | |
return JSON.stringify(obj); | |
}); | |
Handlebars.registerHelper('fixed', function(obj) { | |
return obj.toFixed(2); | |
}); | |
Handlebars.registerHelper('encode', function(obj) { | |
return encodeURIComponent(obj); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Handlebars.registerHelper('json', function(obj) { | |
return JSON.stringify(obj); | |
}); | |
Handlebars.registerHelper('fixed', function(obj) { | |
return obj.toFixed(2); | |
}); | |
Handlebars.registerHelper('encode', function(obj) { | |
return encodeURIComponent(obj); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package objsets | |
import common._ | |
import TweetReader._ | |
/** | |
* A class to represent tweets. | |
*/ | |
class Tweet(val user: String, val text: String, val retweets: Int) { | |
override def toString: String = text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Configuration; | |
using System.Net; | |
using System.Text; | |
using NServiceBus; | |
using Newtonsoft.Json; | |
using RestSharp; | |
public class SendEmailHandler : IHandleMessages<SendEmail> | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task ServiceEndpoints { | |
deploy_endpoint "RelocationMoverServices.Synergize.Handlers" | |
} | |
function global:deploy_endpoint($name) { | |
$project = "$BaseDir\src\$name\$name.csproj" | |
$buildPath = "$DeployBaseDir\$name" | |
$deployPath = "c:\ReloDotNet2_ServiceEndpoints\$name" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Global.asax.cs: | |
public class MvcApplication : HttpApplication | |
{ | |
protected void Application_Start(object sender, EventArgs e) | |
{ | |
// ... | |
ControllerBuilder.Current.SetControllerFactory(new StructureMapControllerFactory()); | |
} | |
StructureMapControllerFactory.cs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="../../jquery-1.6.4-vsdoc.js" /> | |
(function ($) { | |
WEBLINC.areas.add('customerFindAsYouType', function () { | |
(function () { | |
WEBLINC.widgets.add('customerFindAsYouType', function (scope) { | |
$('.customerfindasyoutype', scope) | |
.keypress(function (e) { | |
if (e.keyCode == 13) { |