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
<!-- inlcude/reference jquery --> | |
<style> | |
#cookieMsgContainer {display: none;} | |
#cookieMsg + section {transition: .5s ease-out; z-index: 2000;} | |
#cookieMsg:not(:checked) + section {transform: translateY(100%);} | |
</style> | |
<input type="checkbox" checked id="cookieMsg" style="display: none" /> | |
<section id="cookieMsgContainer" style="position: fixed; bottom: 0; left: 0; background: black; text-align: left; color: white; width: 100vw; padding: 25px; font-family: sans-serif;"> |
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
<script type="text/javascript"> | |
// Use the same ID as the property on the site | |
var gaProperty = 'UA-XXXXXXXX-1'; | |
// Disable tracking if the opt-out cookie exists. | |
var disableStr='ga-disable-'+gaProperty;if(document.cookie.indexOf(disableStr + '=true') > -1) { window[disableStr] = true; } | |
// Opt-out function | |
function gaOptout() { document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2100 23:59:59 UTC; path=/; domain=' + document.location.hostname; window[disableStr] = true; } | |
// check opt-out | |
if (window[disableStr] !== true) { |
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
<!-- | |
NO jQuery needed | |
test: https://jsfiddle.net/BananaAcid/rz3h5kmx/ | |
see the message later again, paste this as url into the nav bar of your browser: | |
javascript:document.getElementById('cookieMsgContainer').style.display='block'; | |
--> |
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
# do not forget to add the server name to your /etc/hosts file | |
# 127.0.0.1 project1.test.local | |
# | |
# Note: 1. Test the config before reloading `httpd -t` or `apachectl configtest`! | |
# 2. You need to soft reload the config or restart apache. | |
# `apachectl -k graceful` or `httpd -k graceful` (idled threads will use the new config) | |
# `sudo /etc/init.d/apache2 reload` or `sudo service apache2 reload` (kills threads) | |
# | |
<VirtualHost project1.test.local:80> | |
ServerName project1.test.local |
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
Test App: | |
https://github.com/BananaAcid/Simple-Electron-Kiosk/blob/master/PATH%20RESULTS | |
------------------------------------------------------------------------------------ | |
electron paths | |
__dirname refers to index.mjs (parallel to loader.babel.js) | |
Be aware of globally installed modules - for unpacked. |
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
// 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
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 | |
} |