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
""" File location: authors/apps/authentication/tests.py | |
Description: tests that a user cannot login with an invalid email address format. | |
""" | |
from django.test import TestCase, Client | |
from .models import UserManager | |
class AuthenticationTest(TestCase): | |
""" Tests authentication functionality of the application such as registration, | |
logging in, log out and refreshing of JWT tokens. |
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 EmojiRichText extends StatelessWidget { | |
const EmojiRichText({ | |
Key key, | |
@required this.text, | |
this.textAlign = TextAlign.start, | |
this.softWrap = true, | |
this.overflow = TextOverflow.clip, | |
this.textScaleFactor = 1.0, |
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
const countries = { | |
ABW: "Aruba", | |
AFG: "Afghanistan", | |
AGO: "Angola", | |
AIA: "Anguilla", | |
ALA: "Åland Islands", | |
ALB: "Albania", | |
AND: "Andorra", | |
ARE: "United Arab Emirates", | |
ARG: "Argentina", |
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
int fib(int n) { | |
// Init: | |
if (n <= 2) { | |
return 1; | |
} | |
int a = fib(n - 1); | |
// Resume 1: | |
int b = fib(n - 2); | |
// Resume 2: | |
return a + b; |
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
#/bin/bash | |
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password | |
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'` | |
if [ -z "$REPO_URL" ]; then | |
echo "-- ERROR: Could not identify Repo url." | |
echo " It is possible this repo is already using SSH instead of HTTPS." | |
exit | |
fi |
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
/** | |
* if n >= 2 => f(n) = f(n - 1) + f(n - 2) | |
* else 1 | |
* | |
* f(30) = f(29) + f(28) | |
* f(29) = f(28) + f(27) | |
* | |
* f(3) = f(2) + f(1) (1 + 1) => 2 | |
* f(2) = 1 | |
* f(1) = 1 |