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
monkbroc@slim:~/Programming/Photon/modules$ make clean all program-dfu PARTICLE_DEVELOP=1 PLATFORM=photon USE_SWD_JTAG=y | |
clean all program-dfu | |
make -C /home/monkbroc/Programming/Photon/modules/photon/system-part1/ clean all program-dfu USE_SWD_JTAG=y PLATFORM=photon PARTICLE_DEVELOP=1 | |
make[1]: Entering directory '/home/monkbroc/Programming/Photon/modules/photon/system-part1' | |
make -C ../../../communication clean | |
make[2]: Entering directory '/home/monkbroc/Programming/Photon/communication' | |
rm -f ../build/target/communication/platform-6-m-prod-6/lib/tropicssl/library/aes.o ../build/target/communication/platform-6-m-prod-6/lib/tropicssl/library/bignum.o ../build/target/communication/platform-6-m-prod-6/lib/tropicssl/library/padlock.o ../build/target/communication/platform-6-m-prod-6/lib/tropicssl/library/rsa.o ../build/target/communication/platform-6-m-prod-6/lib/tropicssl/library/sha1.o ../build/target/communication/platform-6-m-prod-6/src/coap.o ../build/target/communication/platform-6-m-prod-6/src/handshake. |
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
if ENV['ENABLE_GC_PROFILING'] == 'yes' | |
GC::Profiler.enable | |
end |
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
if Nenv.enable_gc_profiling? | |
GC::Profiler.enable | |
end |
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
# Replace this | |
Pusher.app_id = ENV['PUSHER_APP_ID'] | |
Pusher.key = ENV['PUSHER_KEY'] | |
Pusher.secret = ENV['PUSHER_SECRET'] | |
# By this | |
Nenv :pusher do |p| | |
Pusher.app_id = p.app_id | |
Pusher.key = p.key | |
Pusher.secret = p.secret |
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
class DeviseCreateUsers < ActiveRecord::Migration | |
def change | |
create_table(:users) do |t| | |
## Your your user fields | |
t.string :email, default: "" | |
## OmniAuth-able | |
t.string :provider | |
t.string :uid |
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
Devise.setup do |config| | |
# Other configuration... | |
# ==> OmniAuth | |
# Add a OmniAuth providers. | |
User.omniauth_providers.each do |provider_name| | |
if provider_name == :developer | |
config.omniauth :developer | |
else | |
api_key = ENV["#{provider_name.upcase}_API_KEY"] |
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
Rails.application.routes.draw do | |
devise_for :users, :controllers => { | |
:omniauth_callbacks => "users/omniauth_callbacks" | |
} | |
devise_scope :user do | |
get 'sign_in', :to => 'devise/sessions#new', :as => :new_user_session | |
delete 'sign_out', :to => 'devise/sessions#destroy', :as => :destroy_user_session | |
end | |
root 'home#index' |
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
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController | |
skip_before_action :verify_authenticity_token | |
def sign_in_with(provider_name) | |
@user = User.from_omniauth(request.env["omniauth.auth"]) | |
sign_in_and_redirect @user, :event => :authentication | |
set_flash_message(:notice, :success, :kind => provider_name) if is_navigational_format? | |
end | |
def facebook |
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
<ul class="nav"> | |
<% if user_signed_in? -%> | |
<li><%= link_to 'Sign out', destroy_user_session_path, :method => :delete %></li> | |
<% else -%> | |
<li><%= link_to 'Sign in', new_user_session_path %></li> | |
<% end -%> | |
</ul> |
OlderNewer