To quick start:
# move to an empty folder
mkdir my-folder && cd my-folder
# paste regl.js file
pbpaste > regl.js| import React from "react"; | |
| import Select from "react-select"; | |
| class CustomSelect extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { menuIsOpen: false }; | |
| } | |
| import { useRef } from 'react'; | |
| let uniqueId = 0; | |
| const getUniqueId = () => uniqueId++; | |
| export function useComponentId() { | |
| const idRef = useRef(getUniqueId()); | |
| return idRef.current; | |
| } |
For a while, JSX and new es6 syntax had flaky support in emacs, but there's been huge work on a lot of packages. Using emacs for JavaScript with React, ES6, and Flow (or Typescript, etc) is really easy and powerful in Emacs these days.
This is how you can work on modern web development projects with full support for tooling like JSX, Flow types, live eslint errors, automatic prettier.js formatting, and more.
web-modeweb-mode provides most of the underlying functionality, so a huge shout-out to the maintainer(s) there.
docker run -i -t --name nodejs ubuntu:latest /bin/bashSo here, -i stands for interactive mode and -t will allocate a pseudo terminal for us.
Some more trivia about these flags.
| import yaml | |
| from yaml.constructor import ConstructorError | |
| try: | |
| from yaml import CLoader as Loader | |
| except ImportError: | |
| from yaml import Loader | |
| def no_duplicates_constructor(loader, node, deep=False): |
| # in .git/config | |
| [diff "gz"] | |
| # behold, the power of zcat! | |
| textconv = zcat | |
| # and the lovely laziness! | |
| cachetextconv = true | |
| binary = true |