Skip to content

Instantly share code, notes, and snippets.

View vighnesh153's full-sized avatar
Pika-Pi

Vighnesh Raut vighnesh153

Pika-Pi
View GitHub Profile
@vighnesh153
vighnesh153 / mathjax-in-react.md
Created March 13, 2021 11:51 — forked from GiacoCorsiglia/mathjax-in-react.md
Using MathJax v3 in React

Using MathJax v3 in React

Any improvements or alternative approaches are welcome!

One alternative approach can be found in the CharlieMcVicker/mathjax-react library.

Loading MathJax

It may be possible to bundle MathJax with the rest of your JavaScript, which might have the nice consequence of allowing you to import it instead of using the global MathJax object. But I found it simpler to include the following at the bottom of my html file; this is the common way to load MathJax.

@vighnesh153
vighnesh153 / 1-securing-express.md
Created December 13, 2020 04:34 — forked from cerebrl/1-securing-express.md
Securing ExpressJS

tl;dr

  1. Don't run as root.
  2. For sessions, set httpOnly (and secure to true if running over SSL) when setting cookies.
  3. Use the Helmet for secure headers: https://github.com/evilpacket/helmet
  4. Enable csrf for preventing Cross-Site Request Forgery: http://expressjs.com/api.html#csrf
  5. Don't use the deprecated bodyParser() and only use multipart explicitly. To avoid multiparts vulnerability to 'temp file' bloat, use the defer property and pipe() the multipart upload stream to the intended destination.