- Don't run as root.
- For sessions, set
httpOnly
(andsecure
totrue
if running over SSL) when setting cookies. - Use the Helmet for secure headers: https://github.com/evilpacket/helmet
- Enable
csrf
for preventing Cross-Site Request Forgery: http://expressjs.com/api.html#csrf - Don't use the deprecated
bodyParser()
and only use multipart explicitly. To avoid multiparts vulnerability to 'temp file' bloat, use thedefer
property andpipe()
the multipart upload stream to the intended destination.
This file contains 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
class Color { | |
// Reset | |
public static final String RESET = "\033[0m"; // Text Reset | |
// Regular Colors | |
public static final String BLACK = "\033[0;30m"; // BLACK | |
public static final String RED = "\033[0;31m"; // RED | |
public static final String GREEN = "\033[0;32m"; // GREEN | |
public static final String YELLOW = "\033[0;33m"; // YELLOW | |
public static final String BLUE = "\033[0;34m"; // BLUE |
This file contains 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
const audioContext = new (window.AudioContext || window.webkitAudioContext)(); | |
const play = (freq = 440, time = 2000) => { | |
const oscillator = audioContext.createOscillator(); | |
oscillator.connect(audioContext.destination); | |
oscillator.frequency.value = freq; | |
oscillator.start(); | |
setTimeout(() => { |
This file contains 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
Diagram: https://imgur.com/yAcBasD |
This file contains 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
42 |
This file contains 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
const winston = require("winston"); | |
const logger = winston.createLogger({ | |
transports: new winston.transports.File({ | |
filename: "./hello.log", | |
format: winston.format.combine( | |
winston.format.timestamp({ | |
format: "YYYY-MM-DD HH:mm:ss", | |
}), | |
winston.format.json() |
This file contains 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
class PromiseClone { | |
static #HANDLER_TYPES = { | |
THEN: 'THEN', | |
CATCH: 'CATCH', | |
FINALLY: 'FINALLY', | |
}; | |
handlers = []; | |
constructor(executor) { |
Any improvements or alternative approaches are welcome!
One alternative approach can be found in the CharlieMcVicker/mathjax-react library.
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.
This project was bootstrapped with Create React App.
Below you will find some information on how to perform common tasks.
You can find the most recent version of this guide here.
This file contains 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
package vighnesh153.androidx.exo_player_prototype | |
import android.net.Uri | |
import android.os.Build | |
import android.util.Log | |
import android.view.ViewGroup | |
import android.view.accessibility.CaptioningManager.CaptionStyle | |
import android.widget.FrameLayout | |
import androidx.annotation.RequiresApi | |
import androidx.compose.animation.AnimatedVisibility |
OlderNewer