For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.
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
| run ./unpack.sh to create the django directory structure. | |
| make a virtualenv using requirements.txt and enter it. | |
| run ./manage.py syncdb to create databases (sqlite3 by default). | |
| Now you can run the app with ./manage.py runserver | |
| To push back to gist, run ./pack.sh to copy the changed | |
| files to where gist expects to find them, and commit | |
| as usual. | |
| Please update unpack.sh and pack.sh if you add/remove files. |
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
| CCA2 | Name | CCA3 | Nationality | |
|---|---|---|---|---|
| AD | Andorra | AND | Andorran | |
| AE | United Arab Emirates | ARE | Emirati | |
| AF | Afghanistan | AFG | Afghan | |
| AG | Antigua and Barbuda | ATG | Antiguan, Barbudan | |
| AI | Anguilla | AIA | Anguillian | |
| AL | Albania | ALB | Albanian | |
| AM | Armenia | ARM | Armenian | |
| AN | Netherlands Antilles | ANT | Dutch | |
| AO | Angola | AGO | Angolan |
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 logging.config | |
| import os | |
| from django.utils.log import DEFAULT_LOGGING | |
| # Disable Django's logging setup | |
| LOGGING_CONFIG = None | |
| LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper() | |
| logging.config.dictConfig({ |
When using findOrFail() or findOneOrFail() from typeORM, a 500 error is returned if there is no entity (EntityNotFoundError).
To make it returns a 404, use an exception filter as described in https://docs.nestjs.com/exception-filters .
file /src/filters/entity-not-found-exception.filter.ts
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
| # src/api/auth/passport/jwt.strategy.ts | |
| import { ExtractJwt, Strategy } from 'passport-jwt'; | |
| import { PassportStrategy } from '@nestjs/passport'; | |
| import { Injectable } from '@nestjs/common'; | |
| import { ConfigService } from 'src/api/config/config.service'; | |
| import { UsersProvider } from 'src/api/users/users.provider'; | |
| import { JwtService } from '@nestjs/jwt'; | |
| @Injectable() |
OlderNewer