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
$(document).ready(function(){ | |
$.facebox.settings.loadingImage = '/javascripts/facebox/loading.gif'; | |
$.facebox.settings.closeImage = '/javascripts/facebox/closelabel.gif'; | |
$('a[rel*=facebox]').facebox(); | |
}); |
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
function renderLoginForm() { //Implementation here } | |
function renderResourceErrors() { //Implementation here } | |
function renderUnknownError() { //Implementation here } | |
$(document).ready(function(){ | |
$().ajaxError(function(event, request, settings, error) { | |
switch(request.status) { | |
case '401': renderLoginForm(); break; | |
case '406': renderResourceErrors(); break; | |
default: renderUnknownError(); | |
} |
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
// I'm attaching onclick behavior with jQuery and using the Firefox clickmap plugin to see what's been clicked. | |
$(function() { | |
$('#bar .foo').click(function() { | |
s_objectID = 'foo'; | |
}); | |
}); |
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
describe "business #show in HTML" do | |
it "should render the hReview-aggregate microformat" do | |
assigns[:business] = Factory(:business, :name => 'Foo Bar') | |
render 'businesses/show' | |
response.should have_microformat(:hReview-aggregate, :rating => 4, :reviews => 20, :name => 'Foo Bar') | |
response.should have_microformat(:hCard, :name => 'Foo Bar', :address => '123 Fake St') | |
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
<div class="hReview-aggregate"> | |
<div class="item vcard"> | |
<span class="fn org"><%= business.name %></span> | |
<div class="rating"> | |
<span class="count"><%= business.reviews.count %></span> | |
<span class="average"><%= business.stars %></span> | |
</div> | |
</div> | |
</div> |
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
<span id="business_name"><%= @business.name %></span> |
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
<span><%= @business.name %></span> |
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 Hand | |
CARD_VALUES = { 3 => 3, | |
4 => 4, | |
5 => 5, | |
7 => 7, | |
8 => 8, | |
:king => 10, | |
:ace => 11, | |
:second_ace => 1} |
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 User < ActiveRecord::Base | |
acts_as_authentic do |c| | |
c.on_register_with_facebook do |fb_user| | |
self.login = fb_user.name | |
self.email = fb_user.email_hashes.first | |
end | |
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
me = Facebooker::Session.create.fql_query("select uid from user where uid = 1158802706").first | |
me.populate | |
me.name | |
#or | |
me = Facebooker::User.new(1158802706) | |
me.session = Facebook::Session.create | |
me.populate | |
me.name |