npm scriptsare low-level and leverage the actual library you want to use (example:"lint": "eslint ./")package.jsonis a central place to see what scripts are available (alsonpm runwill list all scripts)- When things get too complicated you can always defer to another file (example:
"complex-script": "babel-node tools/complex-script.js") npm scriptsare more powerful than one might first think (pre/post hooks, passing arguments, config variables, chaining, piping, etc...)
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
| if (Element && !Element.prototype.matches) { | |
| var proto = Element.prototype; | |
| proto.matches = proto.matchesSelector || | |
| proto.mozMatchesSelector || proto.msMatchesSelector || | |
| proto.oMatchesSelector || proto.webkitMatchesSelector; | |
| } |
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 React, { Component } from "react"; | |
| import { render } from "react-dom"; | |
| import "./index.css"; | |
| class Widget extends Component { | |
| state = { text: "" }; | |
| handleChange = (e) => { | |
| this.setState({ text: e.target.value }); | |
| }; | |
| render() { |
You can run either of the following snippets in your terminal to generate a markdown list of your VS Code extensions.
code --list-extensions | awk '{ print "* [" $1 "](https://marketplace.visualstudio.com/items\?itemName\=" $1 ")" }'
npx https://gist.github.com/elijahmanor/7f9762a4c2296839ad33e33513e88043
NOTE: You can append | pbcopy to either of the above commands to pipe the output to your Mac's copy/paste buffer.
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
| <!doctype html> | |
| <html lang="en"> | |
| <!-- ... --> | |
| <body> | |
| <div class="reveal"> | |
| <div class="slides"> | |
| <section data-markdown="slides.md" | |
| data-separator="^\n---\n$" | |
| data-vertical="^\n------\n$" | |
| data-notes="^Notes:" |
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
| atom-beautify@0.28.21 | |
| atom-css-comb@3.0.0 | |
| caniuse@0.9.0 | |
| easy-motion-redux@1.0.0 | |
| editorconfig@1.2.4 | |
| emmet@2.4.1 | |
| git-blame@0.4.8 | |
| git-plus@5.12.1 | |
| git-time-machine@1.2.3 | |
| jscs-fixer@1.0.2 |
-
q. How do you comfort a JavaScript bug? a. You console it
-
When a JavaScript date has gone bad, "Don't call me, I'll callback you. I promise!"
-
Dev1 saw a strange JavaScript function & asked, "What is this?". Dev2 responded, "I don't know. I would've called you, but I was in a bind"
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
| #!/usr/bin/env node | |
| const shell = require("shelljs"); | |
| function audit(name) { | |
| const tempDir = `${shell.tempdir()}/audit/${name}`; | |
| shell.mkdir("-p", tempDir); | |
| shell.cd(tempDir); | |
| shell.exec("npm init -y", { silent: true }); | |
| shell.exec(`npm install ${name}`, { silent: true }); |
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
| var array_like = {}; | |
| array_like[ 0 ] = "test 0"; | |
| array_like[ 1 ] = "test 1"; | |
| array_like[ 2 ] = "test 2"; | |
| array_like[ 3 ] = "test 3"; | |
| array_like.length = 4; | |
| array_like.splice = [].splice; |
NewerOlder
