Skip to content

Instantly share code, notes, and snippets.

View CryceTruly's full-sized avatar
🎯
Focusing

cryce truly CryceTruly

🎯
Focusing
View GitHub Profile
{
"AED": "United Arab Emirates Dirham",
"AFN": "Afghan Afghani",
"ALL": "Albanian Lek",
"AMD": "Armenian Dram",
"ANG": "Netherlands Antillean Guilder",
"AOA": "Angolan Kwanza",
"ARS": "Argentine Peso",
"AUD": "Australian Dollar",
"AWG": "Aruban Florin",
[
{
"name":"Afghanistan",
"code":"AF",
"continent":"Asia",
"filename":"afghanistan"
},
{
"name":"Åland Islands",
"continent":"Europe",
@CryceTruly
CryceTruly / titles.ts
Last active July 26, 2019 08:07
Setting dynamic page titles in an angular 2+ app.
Step 1 #Provide a title in the route configuration,Usually in the app.module.ts
{ path: '', component: HomeComponent, data: { title: 'welcome' } },
Step 2 #import {ActivatedRoute } from '@angular/router';
Step 3 #Inject the ActivatedRoute interface in the constructor of your component:
constructor(private router:ActivatedRoute) { }
Step 4,#Subscribe to the data observable and pull out your data variables,use them for what you want.
ngOnInit() {

What does this PR do?

Description of Task to be completed?

How should this be manually tested?

Any background context you want to provide?

What are the relevant pivotal tracker stories?

@CryceTruly
CryceTruly / pipenv.md
Last active February 25, 2019 05:29
pipenv cheetsheet

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell
@CryceTruly
CryceTruly / test_core.py
Last active February 14, 2019 13:11
Simple DJANGO rest api test
import json
from rest_framework.test import APIClient
class TestClass():
def setUp():
self.client = APIClient()
self.register_url=reverse('authentication:register')
def test_create_user(self):
"""Tests if a user can create an account"""
valid_register_data = {
'user': {
@CryceTruly
CryceTruly / flaskmail.py
Last active July 26, 2019 08:10
A basic flask mail snippet
from flask_mail import Mail, Message
from flask import Flask
app = Flask(__name__)
app.config.update(
DEBUG=True,
#EMAIL SETTINGS
MAIL_SERVER='smtp.gmail.com',
MAIL_PORT=465,
MAIL_USE_SSL=True,
MAIL_USERNAME = 'your email',