You can convert SHA-1 hash in hex format (as found in Play console) into base64 hash using next command:
echo 33:4E:48:84:19:50:3A:1F:63:A6:0F:F6:A1:C2:31:E5:01:38:55:2E | xxd -r -p | openssl base64
Output:
M05IhBlQOh9jpg/2ocIx5QE4VS4=
| const domain = 'domain' | |
| const secret = 'supersecret' | |
| const expire = Math.round(Date.now() / 1000) + 120 | |
| const links: { original?: string } = {} | |
| const path = `/${this.filetype}/${this.uid}.${this.fileext}` | |
| const generateToken = ({ path, query = '' }: { path: string; query?: string }): string => { | |
| // generate md5 token | |
| const md5String = crypto |
| const BaseExceptionHandler = use('BaseExceptionHandler'); | |
| const Logger = use('Logger'); | |
| class ExceptionHandler extends BaseExceptionHandler { | |
| async handle(error, { request, response, session, view }) { | |
| const isJSON = request.accepts(['html', 'json']) === 'json'; | |
| const production = process.env.NODE_ENV === 'production'; | |
| if (error.code === 'E_INVALID_SESSION') { | |
| session.flash({ |
| server { | |
| listen %ip%:%web_ssl_port% http2; | |
| server_name %domain_idn% %alias_idn%; | |
| root %docroot%; | |
| index index.php index.html index.htm; | |
| access_log /var/log/nginx/domains/%domain%.log combined; | |
| access_log /var/log/nginx/domains/%domain%.bytes bytes; | |
| error_log /var/log/nginx/domains/%domain%.error.log error; | |
| ssl on; |
You can convert SHA-1 hash in hex format (as found in Play console) into base64 hash using next command:
echo 33:4E:48:84:19:50:3A:1F:63:A6:0F:F6:A1:C2:31:E5:01:38:55:2E | xxd -r -p | openssl base64
Output:
M05IhBlQOh9jpg/2ocIx5QE4VS4=
| var parser = document.createElement('a') | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash" | |
| parser.protocol // => "http:" | |
| parser.host // => "example.com:3000" | |
| parser.hostname // => "example.com" | |
| parser.port // => "3000" | |
| parser.pathname // => "/pathname/" | |
| parser.hash // => "#hash" | |
| parser.search // => "?search=test" |
| # best practice: linux | |
| nano ~/.pgpass | |
| *:5432:*:username:password | |
| chmod 0600 ~/.pgpass | |
| # best practice: windows | |
| edit %APPDATA%\postgresql\pgpass.conf | |
| *:5432:*:username:password | |
| # linux |
| 'use strict' | |
| const fs = require('fs') | |
| const path = require('path') | |
| const { hooks } = require('@adonisjs/ignitor') | |
| hooks.after.providersRegistered(function () { | |
| const View = use('Adonis/Src/View') |
| image: node:latest | |
| cache: | |
| paths: | |
| - node_modules/ | |
| before_script: | |
| - apt-get update -y | |
| - apt-get install rsync openssh-client -y | |
| - npm install |
The solution is simple. Just include the following snippet in your ~/.bashrc (or ~/.bash_profile) and reload your shell environment with source ~/.bashrc. This snippet will create a shell function that will override the builtin command cd with a customized one that scans the entered directory, and every other above, for a file named .gopath.
cd () {
builtin cd "$@"
cdir=$PWD
while [ "$cdir" != "/" ]; do
if [ -e "$cdir/.gopath" ]; then
export GOPATH=$cdir #or GOPATH=$GOPATH:$cdir if you want to keep original $GOPATH| 'use strict' | |
| const colors = use('colors/safe') | |
| const Env = use('Env') | |
| const colorStatus = function (status) { | |
| let colorFn = status >= 500 ? colors.red // red | |
| : status >= 400 ? colors.yellow // yellow | |
| : status >= 300 ? colors.cyan // cyan |