Skip to content

Instantly share code, notes, and snippets.

source 'http://rubygems.org'
# Bundle edge Rails instead:
gem 'rails', :git => 'git://github.com/rails/rails.git',
:branch => '3-0-stable'
gem 'mysql'
gem 'riddle'
gem 'less'
#gem 'css_sprite'
GIT
remote: git://github.com/freelancing-god/thinking-sphinx.git
revision: 5fe4a03
branch: rails3
specs:
thinking-sphinx (2.0.0.rc1)
activerecord (>= 3.0.0.beta3)
riddle (>= 1.0.10)
GIT
## _form.html.erb ##
<%= link_to(image_tag(element.element_data.url(:thumb)), portfolio_add_element_path(element), :remote=>true) %>
## Portfolios_Controller.rb ##
respond_to :js, :html
def add_element
@portfolio = Portfolio.find(portfolio_id)
@element = Element.find(element_id)
$(function() {
$('a[rel=external]').click(function() {
$(location).attr('href',this.href);
});
});
constraints(SoftwareFilter) do
constraints(CategoriesFilter) do
match ':software/:controller/:category1/:category2/:category3/:category4/c(.:format)', :action => :index
match ':software/:controller/:category1/:category2/:category3/:category4/c(/:id(.:format))', :action => :show
match ':software/:controller/:category1/:category2/:category3/:category4/c(/:action(/:id(.:format)))'
match ':software/:controller/:category1/:category2/:category3/c(.:format)', :action => :index
match ':software/:controller/:category1/:category2/:category3/c(/:id(.:format))', :action => :show
match ':software/:controller/:category1/:category2/:category3/c(/:action(/:id(.:format)))'
match ':software/:controller/:category1/:category2/c(.:format)', :action => :index
match ':software/:controller/:category1/:category2/c(/:id(.:format))', :action => :show
# paypal
def checkout_paypal
if cart_total == 0
alert_error("Your cart is empty. If you have just placed an order, please check your email for the confirmation")
redirect_to :back and return
end
setup_response = express_gateway.setup_purchase(100 * in_current_currency(cart_total),
:ip => request.remote_ip,
:return_url => url_for(:action => 'confirm', :only_path => false),
:cancel_return_url => url_for(:controller => 'marketplace', :only_path => false),
- inside_layout 'marketplace_layout' do
%h2{:style => 'font-size:2em'} One More Step! Please Confirm Your Order.
.marketplace_sidebar{:style => 'width:340px'}
.box.shopping_cart
.box_shopping_cart
.border
.header
%h3 Your Order:
/ %p.right= link_to 'Manage my Assets'
.content
require 'hoptoad_notifier/capistrano'
# This defines a deployment "recipe" that you can feed to capistrano
# (http://manuals.rubyonrails.com/read/book/17). It allows you to automate
# (among other things) the deployment of your application.
# =============================================================================
# REQUIRED VARIABLES
# =============================================================================
# You must always specify the application and repository for every recipe. The
# repository must be the URL of the repository you want this recipe to
## Redirect requests to Apache, running on port 8000 on localhost
backend apache {
.host = "ttp.26am.com";
.port = "8080";
}
sub vcl_pipe {
# Note that only the first request to the backend will have
# X-Forwarded-For set. If you use X-Forwarded-For and want to
# have it set for all requests, make sure to have:
# set req.http.connection = "close";
#
# This file configures the New Relic RPM Agent. New Relic RPM monitors
# Rails and Java applications with deep visibility and low overhead. For more
# information, visit www.newrelic.com.
#
# Generated March 31, 2011
#
# This configuration file is custom generated for creativecrash
# Here are the settings that are common to all environments: