##Sass Functions Cheat Sheet
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
{ | |
"files.autoSave": "onFocusChange", | |
"vim.easymotion": true, | |
"vim.incsearch": true, | |
"vim.useSystemClipboard": true, | |
"vim.useCtrlKeys": true, | |
"vim.hlsearch": true, | |
"vim.sneak": true, | |
"vim.easymotionMarkerooundColor": "#020202", | |
"vim.normalModeKeyBindings": [ |
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
{ | |
"[html]": { | |
"editor.defaultFormatter": "vscode.html-language-features" | |
}, | |
"[javascript]": { | |
"editor.defaultFormatter": "vscode.typescript-language-features" | |
}, | |
"[json]": { | |
"editor.defaultFormatter": "vscode.json-language-features" | |
}, |
Microsyntax in Angular allows you to write <div *ngFor="let item of items">{{item}}</div>
instead of <ng-template ngFor [ngForOf]="items"><div>{{item}}</div></ng-template
.
The microsyntax must:
- be know ahead of time so that IDEs can parse it without knowing what is the underlying semantics of the directive or what directives are present.
- must translate to key-value attributes in the DOM.
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
#https://stackoverflow.com/questions/42591099/how-do-i-remove-a-hosted-site-from-firebase | |
firebase hosting:disable |
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
//this function return a color in constrast with the input color | |
// https://medium.com/@MikeKellyWeb/calculating-color-contrast-with-sass-eff39ef23f96 | |
// Color contrast | |
// see demo https://codepen.io/fredyang/pen/RwWQJVo | |
$yiq-text-dark: $gray-900 !default; | |
$yiq-text-light: $white !default; | |
$yiq-contrasted-threshold: 150 !default | |
@function color-yiq($color, $dark: $yiq-text-dark, $light: $yiq-text-light) { | |
$r: red($color); |
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
const catchit = asynFn => (req, res, next) => asynFn(req, res, next).catch(next); | |
//usage | |
router.get('/', catchit(async (req, res, next) => { | |
await data = db.get(); | |
throw 'err'; | |
res.json(data); | |
})); |
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
interface Constructor<T> { | |
new(...args: []): T; | |
} | |
interface Base { | |
} | |
interface Items { | |
items: []; | |
} |
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
// node: v0.10.21 | |
// request: 2.27.0 | |
var request = require('request'); | |
var fs = require('fs'); | |
var r = request.post("http://server.com:3000/"); | |
// See http://nodejs.org/api/stream.html#stream_new_stream_readable_options | |
// for more information about the highWaterMark | |
// Basically, this will make the stream emit smaller chunks of data (ie. more precise upload state) | |
var upload = fs.createReadStream('f.jpg', { highWaterMark: 500 }); |
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
{"lastUpload":"2020-04-22T13:57:07.464Z","extensionVersion":"v3.4.3"} |
NewerOlder