This file contains 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
// 1d array | |
for (var i = 0, len = arr.length; i < len; i++) { | |
if (somevalue < arr[i]) { | |
arr.splice(i, 0, somevalue); | |
break; | |
} | |
} | |
return arr; |
This file contains 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
// 1d array | |
for (var i = 0, len = arr.length; i < len; i++) { | |
if (somevalue < arr[i]) { | |
arr.splice(i, 0, somevalue); | |
break; | |
} | |
} | |
return arr; |
This file contains 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
/** | |
* A linear interpolator for hex colors. | |
* | |
* Based on: | |
* https://gist.github.com/rosszurowski/67f04465c424a9bc0dae | |
* | |
* @param {Number} a (hex color start val) | |
* @param {Number} b (hex color end val) | |
* @param {Number} amount (the amount to fade from a to b) | |
* |
This file contains 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
require 'spec_helper' | |
describe Users::OauthCallbacksController, "handle facebook authentication callback" do | |
describe "#annonymous user" do | |
context "when facebook email doesn't exist in the system" do | |
before(:each) do | |
stub_env_for_omniauth | |
get :facebook |