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 setIFrameSrc(iframe, src) { | |
| var el; | |
| iframe = $(iframe) | |
| if ($.browser.msie) { | |
| // Create a new hidden iframe. | |
| el = $(iframe).clone(); | |
| $(el).css("position", "absolute"); | |
| $(el).css("visibility", "hidden"); | |
| // keep the original iframe id unique! | |
| $(el).attr("id", ""); |
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
| #generate an array of random numbers for a range | |
| def ranGen(maxNum, quantity) | |
| counter = 0 | |
| nums = Array.new | |
| while counter < quantity | |
| member = rand(maxNum) | |
| nums << member | |
| counter = counter + 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
| require 'rubygems' | |
| require 'scrobbler' | |
| require 'net/http' | |
| require 'uri' | |
| require 'hpricot' | |
| require 'cgi' | |
| require 'dbi' | |
| require 'fastercsv' | |
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 'rubygems' | |
| require 'scrobbler' | |
| require 'net/http' | |
| require 'uri' | |
| require 'hpricot' | |
| require 'cgi' | |
| require 'dbi' | |
| require 'fastercsv' | |
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 self.formatViews(number) | |
| number = number.gsub(/(\d)(?=\d{3}+(\.\d*)?$)/, '\1,') | |
| number | |
| 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
| # template.rb | |
| # USAGE: rails -m http://gist.github.com/gists/115163.txt PROJECT_NAME | |
| run "rm public/index.html" | |
| plugin 'thinking_sphinx', :git => 'git://github.com/freelancing-god/thinking-sphinx.git' | |
| plugin 'will_paginate', :git => 'git://github.com/mislav/will_paginate.git' | |
| plugin 'factory_girl', :git => 'git://github.com/thoughtbot/factory_girl.git' | |
| plugin 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git' | |
| plugin 'project_search', :git => 'git://github.com/37signals/project_search.git' | |
| plugin 'hubahuba', :git => 'git://github.com/paulca/hubahuba.git' |
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
| /* | |
| $("#prev ~ sibling) doesnt seem to work in IE7 if the type both the prev and sibling element are of the same type. The examples on jQuery.com dont point this out. | |
| (http://docs.jquery.com/Selectors/siblings#prevsiblings) | |
| below is a workaround. | |
| */ | |
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
| show_feed_form: function(share_message,share_name, share_caption, share_description, share_image_href, share_image_src, share_action_link_text, share_action_link_href, share_user_message_prompt, share_href, callback) | |
| { | |
| var publish = { | |
| method: 'stream.publish', | |
| message: "", | |
| attachment: { | |
| name: share_name, | |
| caption: share_caption, | |
| description: ( |
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
| send_wall_post_to_user: function(idx, facebook_id, message, user_message, post_name, post_description, post_image, post_caption) | |
| { | |
| var params = {}; | |
| params['message'] = user_message; | |
| params['name'] = post_name; | |
| params['description'] = post_description; | |
| params['link'] = 'http://apps.facebook.com/irelandville_dev/'; | |
| params['picture'] = post_image; | |
| params['caption'] = post_caption; | |
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
| get_friend_list: function(facebook_id, limit, order, callback) | |
| { | |
| var friends = FB.Data.query("SELECT first_name, pic_square, uid, last_name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1={0}) ORDER BY {1} LIMIT {2}", parseInt(facebook_id), order, limit); | |
| friends.wait(function(friends){ | |
| callback(friends); | |
| }); | |
| }, |
OlderNewer