Skip to content

Instantly share code, notes, and snippets.

class DiscourseSsoController < ApplicationController
def login
sso = DiscourseUtils::SingleSignOn.parse( request.query_string )
sso.external_id = current_user.id
sso.username = current_user.login
sso.name = current_user.display_name
sso.email = current_user.email
redirect_to( sso.to_url )
end
end
class DiscourseSsoController < ApplicationController
def login
sso = DiscourseUtils::SingleSignOn.parse( request.query_string )
sso.external_id = current_user.id
sso.username = current_user.login
sso.name = current_user.display_name
sso.email = current_user.email
# NEW CONTENT
sso.shop_name = current_user.get_shop_name
sso.shop_url = current_user.get_shop_url
<!DOCTYPE html>
<html>
<head>
<title>Todos</title>
</head>
<body>
<script type="text/x-handlebars">
{{outlet}}
Todos.TodoElementView = Ember.View.extend( {
templateView : 'todo-element',
tagName : 'li'
} );
Ember.Handlebars.helper( 'todo-element', Todos.TodoElementView );
@biot023
biot023 / gist:336e9cc49baae75bb3f6
Created October 3, 2014 14:06
00-server-setup.conf
files:
"/tmp/00-elastic-beanstalk.conf":
mode: "000644",
owner: root,
group: root,
content: |
upstream my_app {
server unix:///var/run/puma/my_app.sock;
}
class HaveXpathContaining < Struct.new( :xpath, :contents )
def matches?( page )
if self.contents.blank?
page.has_xpath?( self.xpath + "[not( text() )]" ) || page.has_xpath?( self.xpath + "[string-length( normalize-space( . ) ) = 0]" )
else
page.has_xpath?( self.xpath + "[contains( ., '#{ self.contents }' )]" )
end
end
describe 'application flow'
before_each
$page = $( fixture( "jqt.html" ) )
end
it 'should start on the login page'
$page.find( "#login" ).should.have_class "current"
end
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>Penny</title>
</head>
<body>
<form accept-charset='utf-8' action='/session.json' class='current' id='login' method='post'>
<div class='toolbar'>
<h1>Login</h1>
describe 'application flow'
before_each
$page = $( fixture( "jqt" ) )
end
it 'should start on the login page'
$page.find( "#login" ).should.have_class( "current" )
end
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8' />
<title>Penny</title>
</head>
<body id="body">
<form accept-charset='utf-8' action='/session.json' class='current' id='login' method='post'>
<div class='toolbar' id='login-c'>