A simple TCP-server setup.
[Using Node-RED]
Easy to test your clients used. Like Telnet and others.
Contains:
- Server
- Client
- Proxy (for clients not terminating their messages with
\n
)
A simple TCP-server setup.
[Using Node-RED]
Easy to test your clients used. Like Telnet and others.
Contains:
\n
)(function($) { | |
function getTextWidth($element) { | |
var tester = $("<div/>").text($element.text()) | |
.css({ "position": "absolute", "float": "left", "white-space": "nowrap", "visibility": "hidden", "font": $element.css("font"), "text-transform": $element.css("text-transform"), "letter-spacing": $element.css("letter-spacing") }) | |
.appendTo($element.parent()), | |
width = tester.innerWidth(); | |
tester.remove(); | |
return width; | |
} |
# Nabil Redmann 2017 | |
# | |
# assumed: this htaccess is within htdocs/ | |
# | |
# dev.* mapping to ./dev/ | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / |
// ˫ routes ˫ index.js | |
GET / | |
// ˫ routes ˫ api1 ˫ index.js | |
GET /api/v1/ | |
GET /api/v1/x | |
// ˫ routes ˫ api1 ˫ a.js | |
PUT /api/v1/a/obj/:one/:two |
//- | |
PhpStorm 2018.1 shows multiple errors and is not able to handle this fully valid PUG mixin | |
mixin test(param1, param2 = "test", optionalParam3) | |
- var xOptionalParam3 = optionalParam3 || "is none"; | |
<!{param1}> !{param2} => !{xOptionalParam3} </!{param1}> | |
<!-- | |
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'; | |
--> |
<!-- 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;"> |
// press and hold button for 1 second to change | |
const int ledRed = 0; | |
const int ledGreen = 1; | |
const int ledBlue = 2; | |
const int btn = 4; | |
int mode = 0; | |
int count = 0; |
<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) { |
# 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 |