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
let options = { | |
host: 'eposthub.de', | |
//port: 80, optional | |
//path: '/' optional | |
} | |
const http = require('http'); | |
let isOk = await new Promise(resolve => { | |
http.request({method:'HEAD', host:options.host, port:options.port, path: options.path}, r => |
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
Show hidden characters
{ | |
"presets": [ | |
"electron" | |
] | |
} |
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
//** https://stackoverflow.com/questions/26007187/node-js-check-if-a-remote-url-exists/51757188#51757188 | |
// options for the http request | |
let options = { | |
host: 'google.de', | |
//port: 80, optional | |
//path: '/' optional | |
} |
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
# install | |
# | |
# $ curl -o- https://gist.githubusercontent.com/BananaAcid/93c319ada91c30ed904e9bc93d324a19/raw/install-nodejs-docker.sh | bash | |
# | |
# installing: | |
# 1. git, | |
# 2. nvm for all users centralized, | |
# 3. nodejs through nvm, | |
# 4. nodejs packages thorugh npm | |
# |
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
<?php | |
/* | |
in case you got a server config, that routes all calls through this index.php | |
will not protect files, except you check the header with the server and re route to this script for validation. | |
... used this on IIS server. Apache, Nginx, Lightttpd, ... have simple onboard means. | |
*/ | |
// simple auth |
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
// npm install murmurhash-native fs-extra -P | |
import path from 'path'; | |
/* experimental (node v10, v11): */ | |
import fsOrig from 'fs'; const fs = fsOrig.promises; | |
// import fs from 'fs-extra'; // awaitable fs for node < v10 | |
import murmur from 'murmurhash-native/stream'; // super fast HASHING ! https://github.com/royaltm/node-murmurhash-native | |
const sPath = process.pwd(); |
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
#!/bin/sh | |
':' //; exec "`command -v node`" "--experimental-modules" "--no-warnings" "$0" "$@" | |
import fsOrig from 'fs'; const fs = fsOrig.promises; | |
import path from 'path'; | |
function delay(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} |
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
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash && export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && nvm install ` nvm ls-remote | tail -1` |
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
//- | |
using the PUGjs pre-compiler, ($ npm i -g pug ) | |
HTML with included PHP will be generated as .php - | |
then served using the webserver as any other PHP file | |
note: | |
lines starting with `<` will be handled as if they were prefixed | |
with `|` (pipe) == that is: as text. | |
indented lines are not inheriting the text-content-mode. |