Skip to content

Instantly share code, notes, and snippets.

STAT pid 839
STAT uptime 5978278
STAT time 1314220040
STAT version 1.4.5
STAT pointer_size 64
STAT rusage_user 234.746670
STAT rusage_system 805.846362
STAT curr_connections 10
STAT total_connections 4947
STAT connection_structures 22
$(".gig").delegate("a[data-editable=true]", "click", function(event){
var self = $(this);
if(event.shiftKey) {
window.location = "/" + self.data("media-type") + "/" + self.data("mid") + "/edit";
return false;
}
});
customers = ["Pelle", "Lars"].map do |name|
Customer.new(name: name, age: rand(123))
end
pop_user # The pop user
book_payments.each do |payment|
book = payment.order.book_purchase.book
authors = [book.author] + book.co_authors
authors.each do |author|
batch.add_amount(author.id, (1 - book.charity_percentage) * author_part(payment.amount.to_f/authors.size.to_f) )
batch.add_amount(pop_user.id, book.charity_percentage * author_part(payment.amount.to_f/authors.size.to_f) )
end
end
cucumber features/plain/screening.feature:10 # Scenario: A non UQEP member can access the screening process
cucumber features/plain/screening.feature:17 # Scenario: A UQEP member can access the screening process
cucumber features/plain/screening.feature:25 # Scenario: Browsing through pending books
cucumber features/plain/screening.feature:44 # Scenario: Updating screening of pending book
cucumber features/plain/screening.feature:65 # Scenario: Accepting a book
cucumber features/plain/screening.feature:76 # Scenario: Rejecting a book
cucumber features/plain/screening.feature:88 # Scenario: Three strikes and you're out
cucumber features/plain/screening.feature:95 # Scenario: Rescreening of a rejected book
cucumber features/plain/screening.feature:152 # Scenario: A UQEP-editor can solely reject and publish books
class Guest
attr_accessor :first_name, :last_name, :age
end
class Hotel
attr_reader :guests
def initialize
@guests = []
end
before :each do
@book = Factory(:book)
@pages = []
5.times { @pages << Factory(:page, :book => @book) }
end
it "should find the spread after" do
prev = Spread.next(Spread.find(@book, 2))
prev.left.should == @pages[3]
prev.right.should == @pages[4]
it "should find the first spread if that's before" do
prev = Spread.previous(Spread.find(@book, 2))
prev.left.should == @pages[0]
prev.right.should == @pages[0]
end
Book.editable_by(current_user).find_by_identifier(params[:book_id]).image_placements.find(params[:id]).save!
# => ActiveRecord::ReadOnlyRecord Exception: ActiveRecord::ReadOnlyRecord
ir = Book.editable_by(current_user).find_by_identifier(params[:book_id]).image_placements.find(params[:id])
ImagePlacement.find(ir.id).save!
# => true
SELECT movies.title, movies.rating, images.url as poster
FROM movies
INNER JOIN torrents ON torrents.movie_id = movies.id
INNER JOIN trackers ON trackers.id = torrents.tracker_id
LEFT JOIN images ON images.movie_id = movies.id
LEFT JOIN sizes ON sizes.id = images.size_id
WHERE movies.active = 1 AND
trackers.id IN (2, 3, 4, 1) AND
(sizes.name = 'cover' OR images.id IS NULL)
GROUP BY movies.id