- Create a self signed key and certificate ( good explanation here )
- Using puma (gem 'puma') do:
puma -b 'ssl://0.0.0.0:3000?key=/path/to/server.key&cert=/path/to/server.crt'
now go to: https://localhost:3000
| var express = require('express') | |
| , routes = require('./routes') | |
| , everyauth = require('everyauth'); | |
| var app = module.exports = express.createServer(); | |
| everyauth.github | |
| .appId('myID') | |
| .appSecret('MySecret') | |
| .scope('user') |
| class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController | |
| def facebook | |
| @user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user) | |
| if @user.persisted? | |
| flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook" | |
| sign_in_and_redirect @user, :event => :authentication | |
| else | |
| session["devise.facebook_data"] = request.env["omniauth.auth"] | |
| redirect_to new_user_registration_url |
| module Docsplit | |
| def self.extract_svg(pdfs, opts={}) | |
| pdfs = ensure_pdfs(pdfs) | |
| SvgExtractor.new.extract(pdfs, opts) | |
| end | |
| class SvgExtractor |
| <%= form_for @book, :html => {:multipart => true} do |f| %> | |
| <% if @book.errors.any? %> | |
| <div id="error_explanation"> | |
| <h2><%= pluralize(@book.errors.count, "error") %> prohibited this book from being saved:</h2> | |
| <ul> | |
| <% @book.errors.full_messages.each do |msg| %> | |
| <li><%= msg %></li> | |
| <% end %> | |
| </ul> |
| /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.10/lib/active_record/connection_adapters/postgresql_adapter.rb:1061:in `async_exec' | |
| /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.10/lib/active_record/connection_adapters/postgresql_adapter.rb:1061:in `exec_no_cache' | |
| /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.10/lib/active_record/connection_adapters/postgresql_adapter.rb:615:in `block in exec_query' | |
| /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.10/lib/active_record/connection_adapters/abstract_adapter.rb:245:in `block in log' | |
| /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.10/lib/active_support/notifications/instrumenter.rb:21:in `instrument' | |
| /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.10/lib/active_record/connection_adapters/abstract_adapter.rb:240:in `log' | |
| /home/ubuntu/.rvm/gems/ruby-1.9.2-p290/gems/newrelic_rpm-3.5.5.38/lib/new_relic/agent/instrumentation/active_record.rb:32:in `block in log_with_newrelic_instrumentati |
| # put this below in your application.rb | |
| module AssetsInitializers | |
| class Railtie < Rails::Railtie | |
| initializer "assets_initializers.initialize_rails", | |
| :group => :assets do |app| | |
| require "#{Rails.root}/lib/settings.rb" | |
| end | |
| end | |
| end |
| # Puppet status codes say 0 for unchanged, 2 for changed succesfully | |
| if [0,2].include? @kafo.exit_code | |
| say " <%= color('Success!', :good) %>" | |
| else | |
| say " <%= color('Something went wrong!', :bad) %> Check the log for ERROR-level output" | |
| end | |
| # Foreman UI? | |
| if @kafo.config.module_enabled? 'foreman' | |
| say " * <%= color('Foreman', :info) %> is running at <%= color('#{param('foreman','foreman_url').value}', :info) %>" |
puma -b 'ssl://0.0.0.0:3000?key=/path/to/server.key&cert=/path/to/server.crt'now go to: https://localhost:3000
| foreman-rake console | |
| f = Fog::Compute.new(:provider => "vsphere", :vsphere_username => "YOUR_USERNAME", :vsphere_password=> "YOUR_PASSWORD", :vsphere_server => "SERVER_IP", :vsphere_expected_pubkey_hash => "HASH_KEY_FROM_FOREMAN_e50d75d6039b177eb5ec59f79d147c") | |
| f.datacenters |
| package controllers | |
| import ( | |
| "beego_react/models" | |
| "github.com/astaxie/beego" | |
| "strconv" | |
| ) | |
| type PostController struct { | |
| beego.Controller |