Runs a connect web server, serving files from /client
on port 3000
.
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
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
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
function convertColorName (name) { | |
var testEl = document.createElement('div'), | |
rgb; | |
testEl.style.backgroundColor = name; | |
rgb = document.body.appendChild(testEl); | |
rgb = window.getComputedStyle(testEl).backgroundColor; | |
document.body.removeChild(testEl); | |
return rgb; |
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
[root@centos mysql]# nc -vz localhost 3306 | |
nc: connect to localhost port 3306 (tcp) failed: Connection refused | |
Connection to localhost 3306 port [tcp/mysql] succeeded! | |
The reason is the first connection is against ::1 (IPv6), and the second to 127.0.0.1. | |
This could be seen with: tcpdump -i lo -n | |
[root@centos mysql]# grep localhost /etc/hosts |