EADDRINUSE 80, 8080
- Type "netstat -aon" on Command Prompt
- Find the relative PID number to 127.0.0.1:8080 (or 3000)
- Run "taskkill /f /pid pidnumber"
const fs = require('fs'); | |
const p = require('path'); | |
const http = require('http'); | |
const https = require('https'); | |
const qs = require('querystring'); | |
const request = (config) => { | |
if (typeof config !== 'object' || config === null) { | |
throw Error('invalid non-object config'); |
var os = require("os"); | |
//Create function to get CPU information | |
function cpuAverage() { | |
//Initialise sum of idle and time of cores and fetch CPU info | |
var totalIdle = 0, totalTick = 0; | |
var cpus = os.cpus(); | |
//Loop through CPU cores |
EADDRINUSE 80, 8080
const fs = require('fs'); | |
const http = require('http'); | |
const https = require('https'); | |
const express = require('express'); | |
const app = express(); | |
app.get('*', (req, res) => res.send('yehh')); | |
http.createServer(app).listen(80); |
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/ | |
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch | |
// async function | |
async function fetchAsync () { | |
// await response of fetch call | |
let response = await fetch('https://api.github.com'); | |
// only proceed once promise is resolved | |
let data = await response.json(); | |
// only proceed once second promise is resolved |
var n = new Notification('Connected', { body: 'Well done mate'} ); | |
setTimeout(() => n.close(), 3000); | |
Notification.permission; | |
Notification.requestPermission().then(console.log).catch(console.error); | |
// https://developer.mozilla.org/en-US/docs/Web/API/notification |
Adds a set of fields with values to the specified stream. If MAXLEN items are exceeded, items are removed from the beginning of the stream to bring the length down to MAXLEN. The "*" field is to autogenerate an item ID, but can be overriden.
Return value
Simple string reply: epoch time (in milliseconds) followed by a .N (for differentiating multiple events on the same millisecond)
var ImgurAPIKey = 'YEAH-IM-NOT-GIVING-THAT'; | |
window.addEventListener('paste', function(e) { | |
function eventPreventDefault(e) { | |
e.preventDefault(); | |
} | |
function getClipboardData(e) { | |
return window.clipboardData || e.clipboardData; | |
} |
/* eslint-disable camelcase */ | |
const os = require('os'); | |
const path = require('path'); | |
const webpack = require('webpack'); | |
const webpackNodeExternals = require('webpack-node-externals'); | |
const TerserPlugin = require('terser-webpack-plugin'); | |
const Client = (env, argv) => { | |
const { mode } = argv; |
const crypto = require('crypto'); | |
const sha256 = s => crypto.createHash('sha256').update(s, 'utf8').digest('hex'); | |
module.exports = { sha256 }; |