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
Application = {}; | |
Application.is = { | |
init : function(navigator) { | |
var platforms = this.platforms, | |
ln = platforms.length, | |
i, platform; | |
navigator = navigator || window.navigator; | |
for (i = 0; i < ln; i++) { |
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 value = 1, | |
other_value = 2, | |
and_another = "what up girl whatchu wearing?", | |
method = function(){ | |
alert('we do it big'); | |
}; |
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
Application.handlers = { | |
registration_submit : function(){ | |
var form = Ext.getCmp('registration_form_panel'); | |
form.submit(); | |
}, | |
poll_submit : function(){ | |
var form = Ext.getCmp('poll_question_2_panel_form'); | |
form.submit(); | |
} | |
}; |
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
Application.handlers = { | |
registration_submit : function(){ | |
var form = Ext.getCmp('registration_form_panel'); | |
form.submit(); | |
}, | |
poll_submit : function(){ | |
var form = Ext.getCmp('poll_question_2_panel_form'); | |
form.submit(); | |
} | |
}; |
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
class CategoriesController < ApplicationController | |
before_filter :require_admin | |
before_filter :get_category, :only => [:show,:edit,:update,:destroy] | |
respond_to :html, :xml, :json | |
responders :flash, :http_cache, :collections | |
def index | |
respond_with( @categories = Category.query(params) ) | |
end |
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
scoped = order("#{ sort_by } #{ direction }") | |
scoped = scoped.where( :publisher_id => params[:publisher_id] ) if params[:publisher_id].present? | |
scoped = scoped.where( :category_id => params[:category_id] ) if params[:category_id].present? | |
scoped = scoped.where( "title like ?", "%#{ params[:title] }%" ) if params[:title].present? | |
scoped = scoped.where( "description like ?", "%#{ params[:description] }%" ) if params[:description].present? | |
scoped = scoped.drafts if params[:drafts_only].present? | |
scoped = scoped.published if params[:published_only].present? |
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
Site.util.number_to_currency = function num2money(n_value) { | |
// validate input | |
if (isNaN(Number(n_value))) return 'ERROR'; | |
// save the sign | |
var b_negative = Boolean(n_value < 0); | |
n_value = Math.abs(n_value); | |
// round to 1/100 precision, add ending zeroes if needed | |
var s_result = String(Math.round(n_value * 1e2) % 1e2 + '00').substring(0, 2); |
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
sudo apt-get -y install git-core build-essential | |
sudo apt-get -y install php5 libapache2-mod-php5 | |
sudo apt-get -y install apache2 | |
sudo apt-get -y install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-json | |
sudo apt-get -y install zlib1g-dev libssl-dev libreadline5-dev libxml2-dev libsqlite3-dev | |
sudo apt-get -y install ruby rubygems | |
sudo apt-get -y install libmysqlclient-dev |