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
| // Prime function | |
| $('.iswitch label input:checked').each(function(){ | |
| $(this).parents("label").addClass("on"); | |
| }) | |
| $(".iswitch label span input:[type=checkbox][checked=false]").each(function(){ | |
| $(this).parents("label").addClass("off"); | |
| }) | |
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
| = form_for(:user, :as => :user, :url => session_path(:user)) do |f| | |
| - begin | |
| = devise_error_messages! | |
| - rescue => e | |
| - nil | |
| %label{:for => @login_param.to_s} Email | |
| = f.text_field :email, :class => "email" | |
| %label{:for => @password_param.to_s} Password | |
| = f.password_field :password, :class => "password" |
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
| -- This nasty constant might as well be a global | |
| global kColorValueMaximum | |
| set kColorValueMaximum to 32767 | |
| -- Using only half the max of 65535 | |
| -- Choose a random color for the background | |
| set randomRed to (random number) * kColorValueMaximum | |
| set randomGreen to (random number) * kColorValueMaximum | |
| set randomBlue to (random number) * kColorValueMaximum | |
| set myBackgroundColor to {randomRed, randomGreen, randomBlue} |
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 the pages access token | |
| accounts = MiniFB.get(u.facebook_access_token, facebook_user["id"], :type => "accounts") | |
| account = accounts.data.first | |
| # Add the app to to the page using the access token | |
| MiniFB.post(account.access_token, "#{account.id}/tabs", :app_id => "189977524185") |
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
| Gems included by the bundle: | |
| * actionmailer (3.1.0) | |
| * actionpack (3.1.0) | |
| * activemodel (3.1.0) | |
| * activerecord (3.1.0) | |
| * activeresource (3.1.0) | |
| * activesupport (3.1.0) | |
| * acts_as_list (0.1.4) | |
| * addressable (2.2.6) | |
| * ancestry (1.2.0 a95aa4b) |
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
| Gems included by the bundle: | |
| * actionmailer (3.1.1) | |
| * actionpack (3.1.1) | |
| * activemodel (3.1.1) | |
| * activerecord (3.1.1) | |
| * activeresource (3.1.1) | |
| * activesupport (3.1.1) | |
| * addressable (2.2.6) | |
| * archive-tar-minitar (0.5.2) | |
| * arel (2.2.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
| 263 def create_links | |
| 264 old_links = self.links.clone | |
| 265 new_links = self.content.scan(LINK_REGEXP) | |
| 266 new_links.each do |link_result| | |
| 267 if current_link = create_or_update_link link_result.first | |
| 268 old_links.delete(current_link) | |
| 269 end | |
| 270 end | |
| 271 | |
| 272 old_links.each do |old_link| |
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
| unless File.exists?("PATH_TO_MOUNT/mounted") | |
| `umount PATH_TO_MOUNT` | |
| `mount -a` | |
| 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
| class Campaign < ActiveRecord::Base | |
| belongs_to :user | |
| #scope :active, where(:active => true) | |
| #scope :not_yet_active, where(:active => false) | |
| validates :goal, :presence => true | |
| validates :url, :presence => true | |
| validates :name_or_twitter, :presence => true | |
| attr_accessor :complete_tweet |
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
| # Returns the data recieved in the request body. | |
| # | |
| # This method support both application/x-www-form-urlencoded and | |
| # multipart/form-data. | |
| def POST | |
| if @env["rack.input"].nil? | |
| raise "Missing rack.input" | |
| elsif @env["rack.request.form_input"].eql? @env["rack.input"] | |
| @env["rack.request.form_hash"] | |
| elsif form_data? || parseable_data? |