-
CTRL + A— Move to the beginning of the line -
CTRL + E— Move to the end of the line -
CTRL + [left arrow]— Move one word backward (on some systems this is ALT + B) -
CTRL + [right arrow]— Move one word forward (on some systems this is ALT + F) -
CTRL + U— (bash) Clear the characters on the line before the current cursor position -
CTRL + U—(zsh) If you're using the zsh, this will clear the entire line -
CTRL + K— Clear the characters on the line after the current cursor position -
ESC + [backspace]— Delete the word in front of the cursor
| # Redis Cheatsheet | |
| # All the commands you need to know | |
| redis-server /path/redis.conf # start redis with the related configuration file | |
| redis-cli # opens a redis prompt | |
| # Strings. |
| docker logs nginx 2>&1 | grep "127." | |
| # ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container |
Workbox runtime caching recipes
Your Service Worker script will need to import in Workbox and initialize it before calling any of the routes documented in this write-up, similar to the below:
importScripts('workbox-sw.prod.v1.3.0.js');
const workbox = new WorkboxSW();
// Placeholder array populated automatically by workboxBuild.injectManifest()This is the process and standard that I use for the vast majority of my Laravel code bases and projects.
For more information about php-cs-fixer visit the project repository: FriendsOfPHP/PHP-CS-FIXER.
Add the following .php_cs file to the root of your project.
.php_cs
| class PromiseSimple { | |
| constructor(executionFunction) { | |
| this.promiseChain = []; | |
| this.handleError = () => {}; | |
| this.onResolve = this.onResolve.bind(this); | |
| this.onReject = this.onReject.bind(this); | |
| executionFunction(this.onResolve, this.onReject); | |
| } |
Here's an example of how to debug Mocha v4 if it hangs.
Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).
If you run your test, you'll notice it hangs:
$ mocha test.js
First of all, please note that token expiration and revoking are two different things.
- Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
- Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.
A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.
Quoted from JWT RFC:
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Example", | |
| "type": "node", | |
| "request": "launch", | |
| "runtimeExecutable": "node", | |
| "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], |