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
function soma(x, y) | |
x + y | |
end | |
# retorna 5 | |
soma(2, 3) |
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
function pizza_favorita() | |
println("Minha 🍕 favorita é de 🎲🎲") | |
end | |
pizza_favorita() |
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
println("Minha 🍕 favorita é de 🎲🎲") |
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
from jupyterhub.auth import Authenticator | |
class NewAuth(Authenticator): | |
# ... | |
def validate_username(self, username): | |
if ' ' in username: | |
return False | |
return super().validate_username(username) |
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
{% extends "page.html" %} | |
{% block main %} | |
<div class="container"> | |
<h1> Your HTML goes here! </h1> | |
</div> | |
{% endblock %} |
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
from jupyterhub.handlers import BaseHandler | |
class SignUpHandler(BaseHandler): | |
"""Render the sign up page.""" | |
async def get(self): | |
html = self.render_template('signup.html') | |
self.finish(html) |
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
from jupyterhub.auth import Authenticator | |
class NewAuth(Authenticator): | |
# ... | |
def get_handlers(self, app): | |
new_handlers = [ | |
(r'/signup', SignUpHandler) | |
] | |
return super().get_handlers(app) + new_handlers |
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
from jupyterhub.auth import Authenticator | |
from tornado import gen | |
class NewAuth(Authenticator): | |
# ... | |
@gen.coroutine | |
def authenticate(self, handler, data): | |
if self.can_login: | |
return data['username'] |
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
from jupyterhub.auth import Authenticator | |
from traitlets import Bool | |
class NewAuth(Authenticator): | |
can_login = Bool( | |
config=True, | |
default=False, | |
help="Allow users to login or not" | |
) |
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
from jupyterhub.auth import Authenticator | |
from tornado import gen | |
class NewAuth(Authenticator): | |
@gen.coroutine | |
def authenticate(self, handler, data): | |
return data['username'] |
NewerOlder