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].
importTemplate: => | |
if C2.user.credentials.length | |
@renderImportConfig() | |
# when creds are missing, create an error popup | |
else | |
content = | |
message: "Warning: Missing Credentials" | |
body: "AWS Credentials are required to import Templates" |
/* Scaled-down Backbone.js demonstration | |
* By Jacob Oscarson (http://twitter.com/jacob414), 2010 | |
* MIT Licenced, see http://www.opensource.org/licenses/mit-license.php */ | |
$(function() { | |
window.ulog = function(msg) { $('#log').append($('<div>'+msg+'</div>')); } | |
// Faking a little bit of Backbone.sync functionallity | |
Backbone.sync = function(method, model, succeeded) { | |
ulog('<strong>'+method + ":</strong> " + model.get('label')); | |
if(typeof model.cid != 'undefined') { |
## | |
# Bash completion scripts | |
## | |
if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then | |
# Git OS X Installer: http://code.google.com/p/git-osx-installer/ | |
. /usr/local/git/contrib/completion/git-completion.bash | |
elif type brew > /dev/null 2>&1 && [ -f `brew --prefix`/etc/bash_completion ]; then | |
# Homebrew: http://mxcl.github.com/homebrew/ | |
. `brew --prefix`/etc/bash_completion | |
elif [ -f /opt/local/etc/bash_completion.d/git ]; then |
## | |
# This file should be renamed ".gitconfig" and placed inside your home directory. | |
## | |
[user] | |
name = YOUR_NAME | |
email = YOUR_EMAIL | |
[github] | |
user = YOUR_GITHUB_USERNAME | |
token = YOUR_GITHUB_TOKEN |