a broken music sharing site, used mtv api
Ruby JavaScript Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
db/migrate
doc
lib
public
script
test
vendor/plugins
.gitignore
README
Rakefile
backup.sh
db.dump.gz

README

how many times the song was used in other sets of yours

redirects

Redirect
  nonce
  nonce_url
  default_url
  nonced

@remote_video = RemoteVideo.find_by_id(params[:remote_video_id])
@remote_artist = RemoteArtist.find_by_name(params[:remote_artist_name])
@remote_videos = RemoteVideo.search(params[:artist_or_song], params[:limit], params[:offset])

Episode
  image_url

Video
  remote_video_id
  remote_video_image_url
  remote_video_title
  remote_video_artist_names
  remote_video_duration

:remote_video_id => video.id,
:remote_video_title => video.title,
:remote_video_duration => video.duration,
:remote_video => video

RemoteArtist
  name
  releases
  website
  categories
  <ul>
    <% @recent_episodes.each { |episode| %>
    <% raise episode.inspect if episode.videos.empty? %>
      <li>
        <table>
          <tr>
            <td>
              <%=link_to(image_tag(episode.videos.first.yahoo_video.images.first.url, {:width => 120}), episode_url(*episode.to_param))%>
            </td>
            <td>
              <ul>
                <li>
                  Set: <%=link_to(episode.title, episode_url(*episode.to_param))%>
                </li>
                <li>
                  VeeJay: <%=link_to(episode.person.nickname, profile_url(episode.person))%>
                </li>
              </ul>
            </td>
          </tr>
        </table>
      </li>
    <% } %>
    <li>
      <%=will_paginate(@recent_episodes)%>
    </li>
  </ul>
              #RemoteVideo.new(attributes[:remote_id], attributes[:title], attributes[:duration], ActiveSupport::JSON.decode(attributes[:artist_names]), attributes[:image_url])

@rating_value = RatingValue['poor']
@poor_rating = create_rating(:value => @rating_value)
@second_poor_rating = create_rating(:value => @rating_value)

      exists  app/models/
      exists  app/controllers/
      exists  app/controllers/
      exists  app/helpers/
      create  app/views/messions
      create  app/views/muser_mailer
      exists  app/controllers/
      exists  app/helpers/
      create  app/views/musers
      exists  config/initializers
      create  test/functional/
      exists  test/functional/
      exists  test/unit/
      exists  test/fixtures/
      create  app/models/muser.rb
      create  app/models/muser_mailer.rb
      create  app/models/muser_observer.rb
      create  app/controllers/messions_controller.rb
      create  app/controllers/musers_controller.rb
      create  lib/authenticated_system.rb
      create  lib/authenticated_test_helper.rb
      create  config/initializers/site_keys.rb
      create  test/functional/messions_controller_test.rb
      create  test/functional/musers_controller_test.rb
      create  test/unit/muser_test.rb
      create  test/unit/muser_mailer_test.rb
      create  test/fixtures/musers.yml
      create  app/helpers/messions_helper.rb
      create  app/helpers/musers_helper.rb
      create  app/views/messions/new.html.erb
      create  app/views/musers/new.html.erb
      create  app/views/musers/_muser_bar.html.erb
      create  app/views/muser_mailer/activation.erb
      create  app/views/muser_mailer/signup_notification.erb
      exists  db/migrate
      create  db/migrate/20081207211816_create_musers.rb


Once finished, don't forget to:

- Add an observer to config/environment.rb
config.active_record.observers = :muser_observer
- Add routes to these resources. In config/routes.rb, insert routes like:
map.signup '/signup', :controller => 'musers', :action => 'new'
map.login  '/login',  :controller => 'messions', :action => 'new'
map.logout '/logout', :controller => 'messions', :action => 'destroy'
map.activate '/activate/:activation_code', :controller => 'musers', :action => 'activate', :activation_code => nil

public set sharing function

      <% form_tag do %>
        <%=error_messages_for(:person, :header_message => "Fail")%>
        <ul>
           <% fields_for(:person) { |person| %>
            <%=person.hidden_field(:email)%>
            <li>
              <%=person.label(:nickname)%>
              <%=person.text_field(:nickname)%>
            </li>
          <% } %>
          <li>
            <%= submit_tag("Finish")%>
          </li>
        </ul>
      <% end %>

IE style
flash messages
add existing video
roundie padding


    <%  current_uri = u(request.protocol << request.host_with_port << request.request_uri)
        title = u(@title)
 
        bookmarklets = {
            :delicious =>   ['del.icio.us', 'delicious.gif' ,'http://del.icio.us/post?url={{url}}&amp;title={{url_encoded_title}}'],
            :digg =>        ['digg it', 'digg.gif', 'http://digg.com/submit?phase=2&amp;url={{url}}&amp;title={{url_encoded_title}}'],
            :spurl =>       ['spurl', 'spurl.gif', 'http://www.spurl.net/spurl.php?title={{url_encoded_title}}&amp;url={{url}}'],
         #  :wists =>       ['wists', 'wists.gif', 'http://wists.com/r.php?c=&amp;r={{url}}&amp;title={{url_encoded_title}}'],
            :simpy =>       ['simpy', 'simpy.gif', 'http://www.simpy.com/simpy/LinkAdd.do?href={{url}}&amp;title={{url_encoded_title}}'],
         #  :newsvine =>    ['newsvine', 'newsvine.gif', 'http://www.newsvine.com/_tools/seed&amp;save?u={{url}}&amp;h={{url_encoded_title}}'],
            :blinklist =>   ['blinklist', 'blinklist.gif', 'http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Description=&amp;Url={{url}}&amp;Title={{url_encoded_title}}'],
            :furl =>        ['furl', 'furl.gif', 'http://www.furl.net/storeIt.jsp?u={{url}}&amp;t={{url_encoded_title}}'],
            :reddit =>      ['reddit', 'reddit.gif', 'http://reddit.com/submit?url={{url}}&amp;title={{url_encoded_title}}'],
         #  :fark =>        ['fark','fark.gif', 'http://cgi.fark.com/cgi/fark/edit.pl?new_url={{url}}&amp;new_comment={{url_encoded_title}}&amp;linktype={{category}}'],
            :blogmarks =>   ['blogmarks', 'blogmarks.gif', 'http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url={{url}}&amp;title={{url_encoded_title}}'],
            :yahoo =>       ['yahoo', 'yahoo.gif', 'http://myweb2.search.yahoo.com/myresults/bookmarklet?u={{url}}&amp;t={{url_encoded_title}}'],
         #  :smarking =>    ['smarking', 'smarking.gif', 'http://smarking.com'],
         #  :segnalo =>     ['segnalo', 'segnalo.gif', 'http://segnalo.com/post.html.php?url={{url}}&amp;title={{url_encoded_title}}'],
            :magnolia =>    ['magnolia', 'magnolia.gif', 'http://ma.gnolia.com/bookmarklet/add?url={{url}}&amp;title={{url_encoded_title}}']
        }
 
     %>
 
   <div>
      <% bookmarklets.each_value { |bookmarklet|
            bookmarklet[2].gsub!(/\\{\\{url\\}\\}/, current_uri)
            bookmarklet[2].gsub!(/(\\{\\{url_encoded_title\\}\\})|(\\{\\{title\\}\\})/, title) -%>
 
        <p><a href="<%= bookmarklet[-1] %>" title="<%= bookmarklet[0] %>:<%= title %>">
            <img src="/images/social/<%= bookmarklet[1] %>" alt="<%= bookmarklet[0] %>" /> <%= bookmarklet[0] %>
        </a></p>
      <% } %>
   </div>

http://www.feedforall.com/social-bookmarking-icons.htm

#drop ul.tabs { margin: 0 0 -0.25em 0; }
#drop ul.tabs li { display: inline; margin: 0 1em 0 0; }
#drop ul.tabs li a { text-decoration: none; padding: 0.6em 0.6em 1em 0.6em; background: #E8DDCB; border: 0px solid #E8DDCB; }
#drop ul.tabs li a.active { /* -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; */ background: #ffffff; border: 0px solid #E8DDCB; padding: 0.6em 0.6em 1em 0.6em; }
#drop ul.tabs li img { margin: 0px 0 0px 0; padding: 0 0 0 0; vertical-align: middle; }
#drop ul.panels { background: #ffffff; }
#drop ul.panels li { padding: 1em; }
#drop ul.panels textarea { border: 0px; width: 100%; }
/*
.pagination { }
.pagination a, .pagination span { font-size: 1.5em; display: block; float: left; padding: 0.25em; }
.pagination span.disabled { }
.pagination span.current { font-weight: bold; color: red; }
.pagination a { text-decoration: none; }
.pagination a:hover, .pagination a:focus { }
.pagination:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
* html .pagination { height: 1%; }
*:first-child+html .pagination { overflow: hidden; }
*/
  <a href="#" onclick="FB.Connect.requireSession(); return false;" >
  <img id="fb_login_image" src="http://static.ak.fbcdn.net/images/fbconnect/login-buttons/connect_light_medium_long.gif" alt="Connect"/>
  </a>
  <a href="#" onclick="push_to_facebook();">wtf</a>

  <fb:login-button onlogin="on_facebook_register();"></fb:login-button>
  <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
  <script type="text/javascript">FB_RequireFeatures(["XFBML"],function(){FB.Facebook.init("974a573be253946712b3d0ab6f3c5c85", "/facebook/xd_receiver");});</script>

ul.tabs { /* general settings */
text-align: left; /* set to left, right or center */
margin: 1px 0 1px 0; /* set margins as desired */
border-bottom: 1px solid #6c6; /* set border COLOR as desired */
list-style-type: none;
padding: 10px 10px 10px 10px; /* THIRD number must change with respect to padding-top (X) below */
}

ul.tabs li { /* do not change */
  display: inline;
}

ul.tabs li.active {
  border: 1px solid red;
  padding: 0px;
  margin: 0px;
  background-color: #E8DDCB;
}

ul.tabs li.active a {
color: #000; /* set selected tab link color as desired */
position: relative;
top: 1px;
padding-top: 10px; /* must change with respect to padding (X) above and below */
background-color: #E8DDCB;
}

ul.tabs li a { /* settings for all tab links */
padding: 10px 10px 10px 10px; /* set padding (tab size) as desired; FIRST number must change with respect to padding-top (X) above */
border: 1px solid #6c6; /* set border COLOR as desired; usually matches border color specified in #tabnav */
color: #666; /* set unselected tab link color as desired */
margin-right: 0px; /* set additional spacing between tabs as desired */
text-decoration: none;
border-bottom: none;
}

ul.tabs li a:hover { /* settings for hover effect */
background: #fff; /* set desired hover color */
}
  <% form_tag(:pop, {:id => "pop_form"}) do %>
    <%=hidden_field_tag(:video_id)%>
    <div id="pop_container">
      <h2>
      </h2>
    </div>
  <% end %>
      session[:facebook_session] = facebook_session
module CacheableFlash
  def self.included(base)
    base.after_filter :write_flash_to_cookie
  end

  def write_flash_to_cookie
    cookie_flash = cookies['flash'] ? JSON.parse(cookies['flash']) : {}

    flash.each do |key, value|
      if cookie_flash[key.to_s].blank?
        cookie_flash[key.to_s] = value
      else
        cookie_flash[key.to_s] << "<br/>#{value}"
      end
    end

    cookies['flash'] = cookie_flash.to_json
    flash.clear
  end
end

function factorit(){
  //a = 4028033;
  a = 6125621;
  //document.pfac.num.value;    //number to be evaluated
  //output="The factors of "+a+" are:\n\n";
  // this does the factors....
  for (x=1; x<=a; x++)
  {
    c=a/x;
    d=Math.floor(c);
    // compare integer answer and division answer
    if(c==d){
      //output = output + x  + "  ";
    } //end if
  } //end for
  //output=output+"\n\nThe prime factors are:  ";
  // prime factor process
  //  this one works!!!!
  pf = "";
  b = a;
  for (e=2; e<=Math.floor(a/2);e++){
    while (b/e==Math.floor(b/e)){
      if(b/e==Math.floor(b/e)){
        pf = pf + e + "x";
        b = b/e;
      }
    }
  }
  //if (pf==""){
  //  pf = b + " is a prime number.    ";
  //}
  pfl = pf.length;
  pf = pf.substr(0,(pfl-1));
  alert(pf);

  // is the window prefix significant?
  //window.document.pfac.worksp.value=output+pf;
} //end function
=begin
    def remember_params
      session[:remembered_params] = params
    end
    def remembered_params
      remembered = session[:remembered_params] || {:controller => :dashboard, :action => :index}
      session[:remembered_params] = nil
      remembered
    end
    def require_person
      flash[:notice] = "Please login first..." and remember_params and redirect_to login_url unless current_person
    end
    def forget
      session.delete(:person_id)
    end
    helper_method :current_person
    def current_person
      if session[:person_id] then
        @current_person ||= Person.find(session[:person_id]) if Person.exists?(session[:person_id])
      else
        false
      end
    end
    helper_method :recent_people
    def recent_people
      Person.paginate(
        :per_page => 10,
        :page => 1,
        :joins => "JOIN findings ON findings.person_id = people.id",
        :group => "findings.person_id",
        :order => "findings.created_at DESC"
      )
    end
    helper_method :is_mobile?
    def is_mobile?
      request.user_agent.to_s.downcase =~ Regexp.new(MOBILE_USER_AGENTS)
    end
=end

#  map.logout '/logout', :controller => 'sessions', :action => 'destroy'
#  map.login '/login', :controller => 'sessions', :action => 'new'
#  map.register '/register', :controller => 'crusers', :action => 'create'
#  map.signup '/signup', :controller => 'crusers', :action => 'new'
#  map.resources :crusers
#  map.resource :session

  # The priority is based upon order of creation: first created -> highest priority.

  # Sample of regular route:
  #   map.connect 'products/:id', :controller => 'catalog', :action => 'view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   map.resources :products

  # Sample resource route with options:
  #   map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }

  # Sample resource route with sub-resources:
  #   map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
  
  # Sample resource route with more complex sub-resources
  #   map.resources :products do |products|
  #     products.resources :comments
  #     products.resources :sales, :collection => { :recent => :get }
  #   end

  # Sample resource route within a namespace:
  #   map.namespace :admin do |admin|
  #     # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
  #     admin.resources :products
  #   end
  #map.resource :person, :member => { :complete => :get }

  # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
  #map.cloud '/cloud', :controller => "welcome", :action => "cloud"
  #map.random '/random', :controller => "welcome", :action => "random"
  #map.random '/plist_of_images_to_rate', :controller => "welcome", :action => "plist_of_images_to_rate"
  #make a share controller

  #map.philosophy '/philosophy', :controller => "welcome", :action => "philosophy"
  #map.findings '/findings', :controller => "welcome", :action => "findings"
  #map.image '/image/:permalink', :controller => "welcome", :action => "image"
  #map.similarities '/similarities/:permalink', :controller => "welcome", :action => "similarities"
#map.play '/play/:id', :controller => "episode", :action => "play"
  # See how all your routes lay out with "rake routes"
  # Install the default routes as the lowest priority.
  # Note: These default routes make all actions in every controller accessible via GET requests. You should
  # consider removing the them or commenting them out if you're using named routes and resources.
  #map.connect ':controller/:action/:id'
  #map.connect ':controller/:action/:id.:format'