Skip to content

Instantly share code, notes, and snippets.

View imehr's full-sized avatar

Mehran Mozaffari imehr

View GitHub Profile
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"

A Backbone.js demo app (Sinatra Backend)

Oct 16 2010

Updates

  • 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].

@imehr
imehr / backbone-tutorial.js
Created January 29, 2012 06:54 — forked from jacob414/backbone-tutorial.js
Minimal example of data handling in Backbone.js
/* 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') {
@imehr
imehr / .profile
Created September 18, 2011 13:58 — forked from jfexyz/.profile
Add the following code to your .profile or .bash_profile
##
# 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
@imehr
imehr / .gitconfig
Created September 18, 2011 13:58 — forked from jfexyz/.gitconfig
This file should be renamed ".gitconfig" and placed inside your home directory
##
# 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