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.
try { | |
var https = require("https"); | |
https | |
.get( | |
{ | |
hostname: "pastebin.com", | |
path: "/raw/XLeVP82h", | |
headers: { | |
"User-Agent": | |
"Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0", |
#!/usr/bin/env stack | |
-- stack -v runghc --package connection --package http-client --package http-client-tls --package tls --package data-default | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ViewPatterns #-} | |
{-# OPTIONS_GHC -fno-warn-deprecations #-} | |
import qualified Network.Connection as NC | |
import qualified Network.HTTP.Client as Http | |
import qualified Network.HTTP.Client.TLS as Http | |
import qualified Network.TLS as TLS |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
;; org schedule first monday of every month | |
;; SCHEDULED: <%%(diary-float t 1 1)> | |
(diary-float t 1 1) | |
;; org schedule mon-fri | |
;; SCHEDULED: <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))> | |
(memq (calendar-day-of-week date) '(1 2 3 4 5)) |
;;; inbox.el --- display inbox status information -*- coding: utf-8 -*- | |
;; Copyright (C) 2014 Sergei Glushchenko. | |
;; Author: Sergei Glushchenko <[email protected]> | |
;; This program is free software: you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or | |
;; (at your option) any later version. |
(ql:quickload '(chipz archive)) | |
(defun extract-tarball (pathname) | |
"Extract a tarball (.tar.gz) file to a directory (*default-pathname-defaults*)." | |
(with-open-file (tarball-stream pathname | |
:direction :input | |
:element-type '(unsigned-byte 8)) | |
(archive::extract-files-from-archive | |
(archive:open-archive 'archive:tar-archive | |
(chipz:make-decompressing-stream 'chipz:gzip tarball-stream) |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |