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
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 |
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
$(".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; | |
} | |
}); |
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
customers = ["Pelle", "Lars"].map do |name| | |
Customer.new(name: name, age: rand(123)) | |
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
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 |
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
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 |
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 Guest | |
attr_accessor :first_name, :last_name, :age | |
end | |
class Hotel | |
attr_reader :guests | |
def initialize | |
@guests = [] | |
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
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] |
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
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 |
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
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 |
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
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 |