Path: /api/app/users/#{facebook_uid}/friends or /api/app/users/#{email}/friends
Method: POST
Params: :uids, :emails, :user
Expected Response: {"data"=>{"tracked_friends_count" => "10"}
| class ArtistPresenter < BasePresenter | |
| include DecoratorHelpers | |
| def initialize(artist, options={}) | |
| super(artist) | |
| @current_user = options[:user] | |
| @score = options[:score] | |
| end | |
| def to_hash |
| import React from "react"; | |
| import Nav from "./nav"; | |
| require('./stylesheets/style.scss'); | |
| React.render( | |
| <Nav />, | |
| document.body | |
| ); |
| def spotify | |
| self.validate_spotify_auth_token if self.spotify_auth_token.present? | |
| config = { | |
| :access_token => self.spotify_auth_token, # initialize the client with an access token to perform authenticated calls | |
| :raise_errors => true, # choose between returning false or raising a proper exception when API calls fails | |
| # Connection properties | |
| :retries => 0, # automatically retry a certain number of times before returning | |
| :read_timeout => 10, # set longer read_timeout, default is 10 seconds | |
| :write_timeout => 10, # set longer write_timeout, default is 10 seconds |
Path: /api/app/users/#{facebook_uid}/friends or /api/app/users/#{email}/friends
Method: POST
Params: :uids, :emails, :user
Expected Response: {"data"=>{"tracked_friends_count" => "10"}
| require "color_text" | |
| class Tacky | |
| def initialize | |
| # all places that are possible wins | |
| @columns = [ | |
| [:a1,:a2,:a3], | |
| [:b1,:b2,:b3], | |
| [:c1,:c2,:c3], |
| FF.calendarPosts = function() { | |
| FF.el.calendar_post_list_item.click(function (e) { | |
| e.preventDefault(); | |
| // set vars on this | |
| var $this = $(this), | |
| item_title = $this.data('title'), | |
| item_permalink = $this.data('permalink'), | |
| item_date = $this.data('date'), |
| case service_time.relation_to_sunday | |
| when "Current" | |
| previous_sunday | |
| when "Before" | |
| if date.wday == service_time.day_of_week | |
| #use date and time | |
| actual_service_time = service_time_with_offset(service_time, date, true) | |
| return upcoming_sunday ? time >= actual_service_time : return previous_sunday |
| class Photo < ActiveRecord::Base | |
| belongs_to :listing, :counter_cache => true | |
| scope :by_landlord, lambda {|landlord_id| joins(:listing).where('landlord_id = ?', landlord_id)} | |
| default_scope order('"photos"."index" ASC') | |
| attr_accessible :index, :image, :image_url, :image_processing | |
| attr_accessor :is_pre_listing | |
| validates_presence_of :listing_id, :unless => :is_pre_listing |
| require 'digest/md5' | |
| class RemoveDuplicateRecords < ActiveRecord::Migration | |
| def self.up | |
| addresses = {} | |
| Listing.find_each do |listing| | |
| digest = Digest::MD5.hexdigest("#{listing.street_address}#{listing.apartment_no}") | |
| if addresses.include?(digest) | |
| listing.destroy | |
| else |
| require 'digest/md5' | |
| class RemoveDuplicateRecords < ActiveRecord::Migration | |
| def self.up | |
| addresses = {} | |
| for Listing.find_each do |listing| | |
| digest = Digest::MD5.hexdigest("#{listing.street_address}#{listing.apartment_no}") | |
| if addresses.include?(digest) | |
| listing.destroy | |
| else |