- Use npx instead of npm
- Instead of using
node ./node_modules/typescript/bin/tsc
usenpx tsc
- Instead of using
- Pass parameter in npm
- If we have a script called tsc to run typescript,
tsc --build --clean
-->npm run tsc -- --build --clean
- If we have a script called tsc to run typescript,
- Shortcut scripts
npm test
-->npm run test
npm start
-->npm run start
npm stop
-->npm run stop
- Pre/Post script hooks - NPM have pre and post scripts that run before and after a script is run
- If we have 3 script in package.json "preecho": "echo pre", "echo": "echo now" "postecho": "echo post", it will run all 3 scripts when run -->
npm run echo
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
function mockFetch(config: { data?: any; headers?: any; json?: boolean; blob?: boolean; text?: boolean | string; status?: any; statusText?: string; error?: object | string; delay?: boolean }) { | |
const { data, headers, json = false, blob = false, text = false, status = 200, statusText = 'Success', error = '', delay = false } = config; | |
if (status >= 400) { | |
return jest.fn().mockImplementation(() => Promise.reject(error)); | |
} | |
const local_headers = { 'Content-type': 'application/json' }; | |
const res = new window.Response(data, { | |
status, | |
statusText, | |
headers: headers && Object.keys(headers).length === 0 ? local_headers : headers, |
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 { VueConstructor } from 'vue/types/umd'; | |
//To use just extend with mixin variable | |
export default (Vue as VueConstructor< | |
Vue & | |
InstanceType<typeof mixin1> & | |
InstanceType<typeof mixin2> | |
>).extend({ | |
mixins: [mixin1, mixin2] |
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
/* Margin and Padding */ | |
.m-0 { | |
margin: 0!important | |
} | |
.mt-0,.my-0 { | |
margin-top: 0!important | |
} | |
.mr-0,.mx-0 { |
blockquote - effectively all browsers (since IE6+, Firefox 2+, Chrome 1+ etc)
output - all (as far as w3schools goes)
picture - all except for IE11, Blackberry browser, IE Mobile and Opera Mini
progress - all ("iOS Safari does not support "indeterminate" elements.")
meter - all except for IE and IE Mobile
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
/*! minireset.css v0.0.3 | MIT License | github.com/jgthms/minireset.css */ | |
html, | |
body, | |
p, | |
ol, | |
ul, | |
li, | |
dl, | |
dt, | |
dd, |
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
div{ | |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; | |
} |
NewerOlder