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.
Set up web-mode
web-mode provides most of the underlying functionality, so a huge shout-out to the maintainer(s) there.
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
| #!/bin/bash | |
| # Create lxc profile with apt caching | |
| # Requires installing apt-cacher-ng to 10.0.4.1 (your host) | |
| # Could be improved by making the actual apt cache host tunable | |
| # Then use like: | |
| # lxc launch -p default -p aptcache ubuntu:16.04 my-cached-container | |
| NAME=aptcache | |
| CACHE_IP=$(ip addr list lxdbr0 | grep -Po 'inet \K[\d.]+') | |
| if ! ping -c 1 "$CACHE_IP" -w 1 >/dev/null 2>&1; then |
- Create a gist if you haven't already.
- Clone your gist:
# make sure to replace `<hash>` with your gist's hash git clone https://gist.github.com/<hash>.git # with https git clone git@gist.github.com:<hash>.git # or with ssh
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 bash | |
| # Ubuntu Server or VM Cleaner. Safe by default; aggressive when asked. | |
| # Example safe: sudo ./clean.sh | |
| # Example aggressive: sudo JOURNAL_DAYS=3 AGGRESSIVE=1 ./clean.sh | |
| # Enable Docker image prune (images only): sudo ./clean.sh --docker-images | |
| # Tested on Ubuntu 20.04, 22.04, 24.04 (server/VM images). | |
| set -Eeuo pipefail | |
| trap 'rc=$?; echo "Error on line $LINENO: $BASH_COMMAND (exit $rc)"; exit $rc' ERR | |
| IFS=$'\n\t' |
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
| <domain type='lxc'> | |
| <name>REPLACE</name> | |
| <memory>327680</memory> | |
| <os> | |
| <type>exe</type> | |
| <init>/sbin/init</init> | |
| </os> | |
| <vcpu>1</vcpu> | |
| <clock offset='utc'/> | |
| <on_poweroff>destroy</on_poweroff> |