Skip to content

Instantly share code, notes, and snippets.

@CodyReichert
CodyReichert / react-es6-flow-emacs-configuration.md
Last active July 28, 2024 04:47
Configuring Emacs for react, es6, and flow

Configuring Emacs for react, es6, and flow

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.

The current kernel/drivers of Fedora 24 do not support the Wifi chip used on my Mac Book Pro. Proprietary Broadcom drivers are packaged and available in the rpmfusion repo.

Verify that your card is a Broadcom using: lspci -vnn -d 14e4:

Sample output:

02:00.0 Network controller [0280]: Broadcom Corporation BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)

Install

Install the rpmfusion repo, note only "nonfree" is required, as the Broadcom Driver is proprietry: http://rpmfusion.org/

@luthfianto
luthfianto / dda.js
Created September 29, 2014 12:48
Digital Differential Analyzer in JavaScript
function dda(x0, y0, x1, y1)
{
const dx = x1 - x0,
dy = y1 - y0,
s = Math.abs(dx) > Math.abs(dy) ? Math.abs(dx) : Math.abs(dy),
xi = dx * 1.0 / s,
yi = dy * 1.0 / s
var x = x0,
y = y0,
@sanxiyn
sanxiyn / lisp.c
Created August 14, 2010 04:16
Lisp
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
enum type {
NIL,