This file contains hidden or 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 |
This file contains hidden or 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
app.directive('clickOutside', ['$document', function ($document) { | |
return { | |
restrict: 'A', | |
scope: { | |
clickOutside: '&' | |
}, | |
link: function (scope, el, attr) { | |
var handler = function (e) { | |
if (el !== e.target && !el[0].contains(e.target) && document.body.contains(e.target)) { | |
scope.$apply(function () { |
This file contains hidden or 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
# `Hash#dig!` | |
# | |
# Like Ruby 2.3's `Hash#dig`, but raises an exception instead of returning `nil` | |
# when a key isn't found. | |
# | |
# Ruby 2.3 introduces the new Hash#dig method for safe extraction of | |
# a nested value. See http://ruby-doc.org/core-2.3.0/Hash.html#method-i-dig. | |
# It is the equivalent of a safely repeated Hash#[]. | |
# | |
# `#dig!`, on the other hand, is the equivalent of a repeated `Hash#fetch`. It's |
This file contains hidden or 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
sudo apt-get install postgresql-9.6 postgresql-server-dev-9.6 postgresql-contrib-9.6 -y | |
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS hstore;'" | |
sudo su - postgres -c "psql template1 -p 5433 -c 'CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";'" | |
sudo systemctl stop postgresql | |
sudo su - postgres -c '/usr/lib/postgresql/9.6/bin/pg_upgrade -b /usr/lib/postgresql/9.3/bin -B /usr/lib/postgresql/9.6/bin \ | |
-d /var/lib/postgresql/9.3/main/ -D /var/lib/postgresql/9.6/main/ \ | |
-O "-c config_file=/etc/postgresql/9.6/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.3/main/postgresql.conf" --link' | |
sudo apt-get remove postgresql-9.3 -y |