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
| Operation | Description | |
|---|---|---|
| add | Add an element to the end of the list or append an elemen | |
| insert | Insert an element at a given position | |
| delete | Delete an element from a given position | |
| display | Display the elements of the list |
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
| | |
| from Flask import Flask, redirect, request, url_for | |
| from flask_sqlalchemy import SQLAlchemy | |
| from flask_login import LoginManager, current_user, login_user, logout_user, login_required | |
| import json | |
| import os | |
| from oauthlib.oauth2 import WebApplicationClient | |
| import requests | |
| # Configuration |
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 'package:flutter/material.dart'; | |
| import 'login.dart'; | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { |
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 'package:flutter/material.dart'; | |
| class LoginForm extends StatefulWidget { | |
| @override | |
| _LoginFormState createState() => _LoginFormState(); | |
| } | |
| class _LoginFormState extends State<LoginForm> { | |
| bool _isHidden = true; |
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 'package:flutter/material.dart'; | |
| class LoginForm extends StatefulWidget { | |
| @override | |
| _LoginFormState createState() => _LoginFormState(); | |
| } | |
| class _LoginFormState extends State<LoginForm> { | |
| bool _isHidden = true; |
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 'package:flutter/material.dart'; | |
| class LoginForm extends StatefulWidget { | |
| @override | |
| _LoginFormState createState() => _LoginFormState(); | |
| } | |
| class _LoginFormState extends State<LoginForm> { | |
| bool _isHidden = true; |
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 'package:flutter/material.dart'; | |
| class LoginForm extends StatefulWidget { | |
| @override | |
| _LoginFormState createState() => _LoginFormState(); | |
| } | |
| class _LoginFormState extends State<LoginForm> { | |
| bool _isHidden = true; |
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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <!-- Required meta tags --> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
| <!-- Bootstrap CSS --> | |
| <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous"> |
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
| {% extends 'base.html' %} | |
| {% block content %} | |
| <h1 class="text-center mb-3">{% block title %} Welcome to Shorty {% endblock %}</h1> | |
| <div class="row"> | |
| <div class="col-md-2"></div> | |
| <div class="col-md-8"> | |
| <form method="post" action="{{url_for('index')}}"> | |
| <div class="form-floating mb-3"> | |
| <input type="text" name="url" id="url" |
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
| from datetime import datetime | |
| from app.models import ShortUrls | |
| from app import app, db | |
| from flask import render_template, request, flash, redirect, url_for | |
| @app.route('/', methods=['GET', 'POST']) | |
| def index(): | |
| if request.method == 'POST': | |
| url = request.form['url'] | |
| short_id = request.form['custom_id'] |