Skip to content

Instantly share code, notes, and snippets.

def size_upload
result = {:export => {use: []}}
return result unless self.uploads_enabled?
result[:resize] = result[:encode] = {
width: self.upload_width,
height: self.upload_height
} if self.upload_width? && self.upload_height?
result[:resize_thumb] = result[:encode_thumb] = {
@akasper
akasper / post_csv.rb
Created September 21, 2011 15:13
With many page IDs
require 'rubygems'
require 'httparty'
require 'json'
require 'csv'
PAGE_IDS = ['vitrue', 'buddymedia' ] # ... and so on
ACCESS_TOKEN = 'AAACEdEose0cBAMRhF8cj7Gzt1SpNxPwW28dHkXPDLjqRVo2gfxB3lpDDZCdBZAyYv4xn1mTLtJn7c5s6MTBjEIYC73QR7fU1wHxjGShgZDZD'
def url_for_posts(page_id, token=ACCESS_TOKEN)
"https://graph.facebook.com/#{page_id}/posts?limit=500&access_token=#{token}"
@akasper
akasper / store.rb
Created January 12, 2012 19:57
RSpec "double"
class Store
def foo
Storage.store "abc", "bbc"
end
# def bar
# storage = Storage.new
# storage.some_instance_method "cnn"
# end
@javascript
Feature: Device Info
As a Tapjoy employee
I want to search devices
So that I can efficiently manage their clicks, apps and rewards
Scenario: Visiting the "device info" page without a search
Given I have not submitted any searches on the "device info" page
When I visit the "device info" page
Then I should see the search bar
@javascript
Feature: Device Info
As a Tapjoy employee
I want to search devices
So that I can efficiently manage their clicks, apps and rewards
Scenario: Visiting the "device info" page without a search
When I visit the device info "show" page
Then I should see the "search bar"
And I should not see the "Apps Section"