# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
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
" execute pathogen plugins | |
execute pathogen#infect() | |
syntax on | |
filetype plugin indent on | |
set nocompatible " Disable vi-compatibility | |
set t_Co=256 | |
colorscheme xoria256 | |
set guifont=menlo\ for\ powerline:h16 |
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
# to add a new user (fill in the details as prompted) | |
sudo adduser username | |
# grant root priviledges to a user | |
sudo /usr/sbin/visudo | |
# add this after the line that says "root ALL=(ALL:ALL) ALL" | |
username ALL=(ALL:ALL) ALL | |
# if you want to change the password later |
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
# Turn on password authentication | |
sudo sed -i ‘s/^PasswordAuthentication.*/PasswordAuthentication yes/’ /etc/ssh/sshd_config | |
# Reload SSH/SSHd configuration | |
sudo service ssh reload | |
# Set a password for the ubuntu (for ubuntu instances, otherwise use the default username for that instance type) | |
sudo passwd ubuntu |
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
/** | |
* An example CORS-compliant method. It will allow any GET, POST, or OPTIONS requests from any | |
* origin. | |
* | |
* In a production environment, you probably want to be more restrictive, but this gives you | |
* the general idea of what is involved. For the nitty-gritty low-down, read: | |
* | |
* - https://developer.mozilla.org/en/HTTP_access_control | |
* - http://www.w3.org/TR/cors/ | |
* |
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 DEBUG_MODE = true; // Set this value to false for production | |
if(typeof(console) === 'undefined') { | |
console = {} | |
} | |
if(!DEBUG_MODE || typeof(console.log) === 'undefined') { | |
// FYI: Firebug might get cranky... | |
console.log = console.error = console.info = console.debug = console.warn = console.trace = console.dir = console.dirxml = console.group = console.groupEnd = console.time = console.timeEnd = console.assert = console.profile = function() {}; | |
} |
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
// rest of the model specs | |
// ... | |
/** | |
* Save the changes to the model on input change. | |
* | |
* USAGE: events: { "change input, select, checkbox, textarea": "changed" } | |
* | |
* LICENSE: This function is subject to version 3 of the GNU General | |
* Public License that is available through the world-wide-web at the | |
* following URI: http://opensource.org/licenses/gpl-3.0.html. If you |
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
<!-- Full Name --> | |
<div class="control-group"> | |
<label class="control-label" for="name">Full Name</label> | |
<div class="controls"> | |
<div class="input-prepend"> | |
<span class="add-on"> | |
<i class="icon-certificate"></i> | |
</span> | |
<input id="name" name="clients[name]" type="text" class="input" placeholder="Allied Insurance" data-error-style="inline"> | |
</div> |
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
_.extend Backbone.Validation.callbacks, | |
valid: (view, attr, selector) -> | |
control = view.$('[' + selector + '=' + attr + ']') | |
group = control.parents(".control-group") | |
group.removeClass("error") | |
if control.data("error-style") == "tooltip" | |
# CAUTION: calling tooltip("hide") on an uninitialized tooltip | |
# causes bootstraps tooltips to crash somehow... | |
control.tooltip "hide" if control.data("tooltip") |
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
namespace.views.MyWizard = Backbone.Views.extend({ | |
initialize: function() { | |
_.bindAll(this, 'render', 'wizardMethod'); | |
} | |
render: function() { | |
this.wizardMethod(); | |
return this; | |
}, |