Component with popup using Angular CDK Overlay
Template:
<ng-template #templateRef>
Popup content
</ng-template>
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then | |
// use window.btoa' step. According to my tests, this appears to be a faster approach: | |
// http://jsperf.com/encoding-xhr-image-data/5 | |
/* | |
MIT LICENSE | |
Copyright 2011 Jon Leighton | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONIN |
# Important note: If you want the code in this project to be formatted as per the formatting configuration mentioned in this '.editorconfig' file, then open webstorm, go to 'File' => 'Setting' => 'Editor' => 'Code Style' => 'EditorConfig' => Set 'Enable EditorConfig Support' to true => Click 'Apply' => Click 'Ok' | |
# For Knowledge: The formatting settings of webstorm IDE of various file types, like Javascript, json, Typescript files, only apply when the above mentioned checkbox of 'Enable EditorConfig support' is set to false. | |
[*] | |
charset = utf-8 | |
end_of_line = lf | |
indent_size = 2 | |
indent_style = space | |
insert_final_newline = false | |
max_line_length = 120 |
package mycrypto | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"encoding/base64" | |
"io" | |
"time" | |
) |
:root { | |
--material-color-red: #f44336; | |
--material-color-red-50: #ffebee; | |
--material-color-red-100: #ffcdd2; | |
--material-color-red-200: #ef9a9a; | |
--material-color-red-300: #e57373; | |
--material-color-red-400: #ef5350; | |
--material-color-red-500: var(--material-color-red); | |
--material-color-red-600: #e53935; | |
--material-color-red-700: #d32f2f; |
Template:
<ng-template #templateRef>
Popup content
</ng-template>
version: '3.1' | |
services: | |
registry: | |
restart: always | |
image: registry:2 | |
volumes: | |
- registry:/var/lib/registry | |
environment: | |
- REGISTRY_HTTP_ADDR=0.0.0.0:5000 |
First of all, please note that token expiration and revoking are two different things.
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:
You know the pain, you cloned a repo over HTTPS, and now Git asks you for your password each time you want to push or pull.
Chances are you already have the git credential-osxkeychain
command installed.
If not, just install Git with brew: brew install git
.
Once installed, just tell Git to use the KeyChain to store your credentials:
git config --global credential.helper osxkeychain
/** | |
* Generates a MongoDB-style ObjectId in Node.js. Uses nanosecond timestamp in place of counter; | |
* should be impossible for same process to generate multiple objectId in same nanosecond? (clock | |
* drift can result in an *extremely* remote possibility of id conflicts). | |
* | |
* @returns {string} Id in same format as MongoDB ObjectId. | |
*/ | |
function objectId() { | |
const os = require('os'); | |
const crypto = require('crypto'); |