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
set :application, "mealcloud" | |
set :scm, :git | |
set :user, "root" | |
set :password, "password_is_here" | |
set :repository, "ssh://[email protected]/git/mealcloud.git" | |
set :branch, "release/test_server" | |
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` | |
role :web, "31.222.158.20" # Your HTTP server, Apache/etc |
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 MainOrderScreenController < ApplicationController | |
def index | |
@items = Item.all | |
@current_order = Order.find(session[:order_id]) | |
end | |
def add_item_to_order | |
@item = Item.find(params[:id]) | |
@order = Order.new #Don't create an order until there is an item to be added to it. | |
@order.items.push(@item) |
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
#define VERSION "P2V3_3 by Mark Provan. Updated last on 24/11/11\n" | |
#include <stdio.h> | |
#include <string.h> | |
#include <time.h> | |
static clock_t _startTick,_stopTick; | |
#define SNAP() (_startTick = clock()) | |
#define SHOT() (_stopTick = clock()) | |
#define ELAPSED() (_stopTick - _startTick) |
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
<h3>Order Summary</h3> | |
<p class="header_tagline">Click an item to remove it.</p> | |
<% unless @current_order.nil? %> | |
<ul id="order_items"> | |
<% @current_order.order_items.each do |item| %> | |
<li class="small gray button"><%= link_to item.get_item.name, remove_item_from_order_path(item.id) %> £<%= item.get_item.sale_price %></li> #Add another of this line via JS | |
<% end%> | |
</ul> | |
<p class="order_total">Order Total: <%= number_to_currency(@current_order.total, :unit => "£")%></p> | |
<%= link_to "Confirm Order", finalise_order_path, :class => "small green button"%> |
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
def find_links(page) | |
links = find_links() | |
links.each do |link| | |
find_links() | |
end | |
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
require 'nokogiri' | |
require 'net/http' | |
require 'open-uri' | |
require 'pp' | |
start_url = "http://www.vamosa.com/" | |
@pages_to_visit = [] | |
@pages_visited = [] | |
@start_time = Time.now |
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
require 'net/http' | |
require 'open-uri' | |
require 'nokogiri' | |
require 'uri' | |
class Crawler | |
attr_accessor :visited_links, :links_to_visit | |
def initialize(starting_link) | |
self.visited_links = [] | |
self.links_to_visit = [] |
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
➜ ~ initdb /usr/local/var/postgres | |
The files belonging to this database system will be owned by user "mark". | |
This user must also own the server process. | |
The database cluster will be initialized with locale en_GB.UTF-8. | |
The default database encoding has accordingly been set to UTF8. | |
The default text search configuration will be set to "english". | |
creating directory /usr/local/var/postgres ... ok | |
creating subdirectories ... ok |
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
2012-03-18T00:15:21+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/abstract_controller/rendering.rb:88:in `render' | |
2012-03-18T00:15:21+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_controller/metal/rendering.rb:16:in `render' | |
2012-03-18T00:15:21+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render' | |
2012-03-18T00:15:21+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/core_ext/benchmark.rb:5:in `block in ms' | |
2012-03-18T00:15:21+00:00 app[web.1]: vendor/ruby-1.9.3-p0/lib/ruby/1.9.1/benchmark.rb:295:in `realtime' | |
2012-03-18T00:15:21+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.1/lib/active_support/core_ext/benchmark.rb:5:in `ms' | |
2012-03-18T00:15:21+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.1/lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime' | |
2012-03-18T0 |
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
require 'spec_helper' | |
describe SearchRequest do | |
it { should validate_presence_of(:query) } | |
it { should have_many(:products) } | |
before do | |
@search_request = FactoryGirl.build(:search) | |
@recent_search = FactoryGirl.build(:recent_search) | |
end |
OlderNewer