This file contains 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
define([ | |
// Application. | |
"app"], | |
function(app) { | |
var Notification = app.module(); | |
Notification.Model = Backbone.Model.extend({ | |
unread: function(){ |
This file contains 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
module NormalizedModel | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def has_data_fields(fields) | |
include Cloud2Health::NormalizedModel::InstanceMethods | |
serialize :data |
This file contains 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
class Readings::BloodPressure < Readings::Base | |
has_data_fields [:diastolic, :systolic] | |
validates :diastolic, :numericality => {:greater_than => 0} | |
validates :systolic, :numericality => {:greater_than => 0} | |
def self.display_name | |
"Blood Pressure" | |
end |
This file contains 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
class UserSessionsController < ApplicationController | |
skip_before_filter :require_login, :only => [:new, :create, :authenticate] | |
rescue_from User::NotActivated do |e| | |
flash.now.alert = "You are not activted" | |
render :not_activated | |
end | |
rescue_from User::InvalidPassword do |e| | |
flash.now.alert = "Invalid email or password" |
This file contains 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
class Post < ActiveRecord::Base | |
attr_accessible :user, :description, :role, :guid, :created_at, :group, :gpoint | |
belongs_to :user | |
has_many :notifications, :as => :notifiable | |
has_data_fields [:gpoint, :group] | |
validates_presence_of :user_id, :description |
This file contains 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 Foods = { | |
category: function(cats_url){ | |
var promise = $.Deferred(); | |
$.ajax(cats_url, { | |
success: function(dat) { | |
promise.resolve(dat); | |
} | |
error: function(){ | |
var error = 'invalid food'; | |
promise.reject(error); |
This file contains 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
after ssh into the instance | |
cd ~/echo | |
eval $(ssh-agent) # to check if ssh agent is running | |
ssh-add ~/.ssh/prod_deploy # if unfortunately not then we need to re-add the key | |
git pull origin develop | |
fab build_release # build the app | |
mv /home/ubuntu/echo-0.1.0.tar.gz /home/ubuntu/echo-0.1.0.tar.gz.2016.03.30.2014 # move away the current version, remember to change the date/time | |
mv /home/ubuntu/echo/rel/echo/echo-0.1.0.tar.gz /home/ubuntu # move the new release over | |
cd /srv/prod | |
sudo tar xvzf /home/ubuntu/echo-0.1.0.tar.gz |