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
| Homebrew build logs for osrf/simulation/gazebo8 on macOS 10.14.5 | |
| Build date: 2019-05-28 06:44:45 |
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
| import numpy as np | |
| import subprocess | |
| import os | |
| import math | |
| template = """NAME: {name} | |
| TYPE: TSP | |
| COMMENT: {name} | |
| DIMENSION: {n_cities} | |
| EDGE_WEIGHT_TYPE: EXPLICIT |
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
| class ApplicationController < ActionController::Base | |
| protect_from_forgery with: :exception | |
| helper_method :current_user | |
| def authenticate | |
| redirect_to :login unless user_signed_in? | |
| end | |
| def current_user |
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
| <% if current_user %> | |
| <% current_user.attributes.each do |k, v| %> | |
| <b><%= k %>:</b> <%= v %> <br> | |
| <% end %> | |
| <% end %> |
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
| <h1> Welcome, please login to continue </h1> | |
| <a href="/auth/google_oauth2">Sign in with Google</a> |
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
| class ApplicationController < ActionController::Base | |
| protect_from_forgery with: :exception | |
| helper_method :current_user | |
| def authenticate | |
| redirect_to :login unless user_signed_in? | |
| end | |
| def current_user | |
| @current_user ||= User.find(session[:user_id]) if session[:user_id] |
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
| class MeController < ApplicationController | |
| before_action :authenticate | |
| def show | |
| end | |
| end |
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
| class HomeController < ApplicationController | |
| def show | |
| end | |
| end |
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
| Rails.application.config.middleware.use OmniAuth::Builder do | |
| provider :google_oauth2, "GOOGLE_CLIENT_ID", "GOOGLE_CLIENT_SECRET" | |
| end |
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
| Rails.application.routes.draw do | |
| get 'login', to: redirect('/auth/google_oauth2'), as: 'login' | |
| get 'logout', to: 'sessions#destroy', as: 'logout' | |
| get 'auth/:provider/callback', to: 'sessions#create' | |
| get 'auth/failure', to: redirect('/') | |
| get 'home', to: 'home#show' | |
| get 'me', to: 'me#show', as: 'me' | |
| root to: "home#show" |
NewerOlder