##Unit##
http://stackoverflow.com/questions/14903273/how-to-unit-test-views-in-ember-js
##Integration##
https://www.youtube.com/watch?v=heK78M6Ql9Q
http://stackoverflow.com/questions/14903273/how-to-unit-test-views-in-ember-js
require 'net/http' | |
require 'uri' | |
require 'open-uri' | |
400.times do | |
begin | |
http = Net::HTTP.new("graph.facebook.com", 443) | |
http.use_ssl = true | |
http.start do |http| | |
req = Net::HTTP::Get.new("/APPID/accounts/test-users?installed=true&name=josh&locale=en_US&permissions=xmpp_login&method=post&access_token=TOKEN") |
require 'net/http' | |
require 'uri' | |
require 'open-uri' | |
require 'crack/json' | |
http = Net::HTTP.new("graph.facebook.com", 443) | |
http.use_ssl = true | |
http.start do |http| | |
req = Net::HTTP::Get.new("/APPID/accounts/test-users?access_token=TOKEN&limit=500") | |
response = http.request(req) |
// This is the core part of Pitchfork.com's Backbone app. | |
// The autobahn object in particular is a great example of how to layer backbone on to a traditional, CMS-driven media site while maintaing server-side view rendering. | |
var p4k = window.p4k || {}; | |
$(function() { | |
var a = p4k.core = p4k.core || {}; | |
a.Task = function(c, b) { | |
this.fn = c; | |
this.initialize(b) | |
}; |
buildArrayFromKeys: (keys, object) -> | |
arr = [] | |
keys.forEach (i) -> | |
arr.push _.clone(object[i]) | |
arr |
consumer = OmniAuth::Strategies::Yahoo.new(nil, consumer_key, consumer_secret).consumer | |
request_token = OAuth::RequestToken.new(consumer, token, secret ) | |
token = OAuth::Token.new(token, secret ) | |
access_token = request_token.get_access_token(:oauth_session_handle => self.session_handle, :token => token) | |
# Example OAuth signed API endpoint GET request | |
api_request = "http://social.yahooapis.com/v1/user/#{guid}/contacts" | |
response = access_token.get(api_request) |
client = OmniAuth::Strategies::Windowslive.new( nil, windowslive_app_id, windowslive_app_consumer_secret).client | |
@access_token = OAuth2::AccessToken.new(client, refresh_token) | |
@access_token.refresh! | |
# Example API endpoint request | |
api_request_url = "https://apis.live.net/v5.0/me/contacts" | |
access_token.request(:get, api_request_url) |
binarySearch = (array, key) -> | |
lo = 0 | |
hi = array.length -1 | |
while lo <= hi | |
mid = lo + (hi - lo) /2 | |
if(key < array[mid] | |
hi = mid - 1 | |
else if key > array[mid] | |
lo = mid + 1 | |
else |
controller = | |
### | |
From HTML5Rocks | |
Even if you connect the gamepad, it won't manifest itself in any way unless the user | |
presses any of its buttons first. This is to prevent fingerprinting, although proves to be | |
a bit of a challenge for user experience: you can't ask the user to press the button or | |
provide gamepad-specific instructions because you have no idea whether they connected | |
their controller. | |
Chrome's implementation of the API exposes a function – navigator.webkitGetGamepads() – |
Gemfile:
group :development do
gem 'rspec-rails'
gem 'guard'
gem 'guard-rspec'
end
group :test do
gem 'rspec'