Oct 16 2010
- 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments
In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].
<?xml version="1.0" encoding="utf-8"?> | |
<!-- #### NOTE #### --> | |
<!-- To build with Mono's xbuild on bash, you must execute [`sudo install-nuget.sh`](https://gist.github.com/2595337) first. --> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir> | |
<!-- Windows specific commands --> |
function global:ExposeIIS() | |
{ | |
$config = [xml] ( get-content $env:IIS_USER_HOME/config/applicationhost.config ) | |
# Add in new bindings for computer name | |
foreach($site in $config.configuration."system.applicationHost".sites.site) | |
{ | |
foreach($bindings in $site.bindings) | |
{ | |
# no need to add another binding for machine name if its exists |
// Copyright (c) 2012 Daniel Grunwald | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
// software and associated documentation files (the "Software"), to deal in the Software | |
// without restriction, including without limitation the rights to use, copy, modify, merge, | |
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons | |
// to whom the Software is furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in all copies or | |
// substantial portions of the Software. |
var fs = require('fs'); | |
var vm = require('vm'); | |
var emberjs = fs.readFileSync('public/javascripts/vendor/ember-0.9.5.min.js', 'utf8'); | |
var templatesDir = 'templates'; | |
var destinationDir = 'public/javascripts/templates'; | |
function compileHandlebarsTemplate(templatesDir, fileName) { | |
var file = templatesDir + '/' + fileName; |
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> | |
<ParameterGroup> | |
<OutputFilename ParameterType="System.String" Required="true" /> | |
</ParameterGroup> | |
<Task> | |
<Reference Include="System.Core" /> | |
<Reference Include="System.Xml" /> | |
<Reference Include="WindowsBase" /> | |
<Using Namespace="System" /> | |
<Using Namespace="System.IO" /> |
public class CustomErrorHandler : IErrorHandler | |
{ | |
private readonly IViewFactory factory; | |
private readonly IViewLocationCache cache; | |
public CustomErrorHandler(IViewFactory factory, IViewLocationCache cache) | |
{ | |
this.factory = factory; | |
this.cache = cache; | |
} |
Task.Factory.StartNew((state) => | |
{ | |
try | |
{ | |
// use http://nuget.org/packages/TransientFaultHandling.Core | |
// the defaultfixed strategy retries 10 times every 1 second | |
RetryPolicy.DefaultFixed.ExecuteAction(() => | |
{ | |
// do something that might throw an exception like calling an http endpoint | |
}); |
#!/bin/sh | |
current_dir=`pwd` | |
temp_dir=`mktemp -d nuget-curl` | |
cd $temp_dir | |
curl -O http://anglicangeek.com/nuget.exe | |
rm -rf /usr/local/libexec/nuget.exe | |
mv ./nuget.exe /usr/local/libexec/ | |
cd $current_dir | |
rm -rf $temp_dir | |
rm -rf /usr/bin/local/nuget |