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
<osm-script output="xml" timeout="2000"> | |
<id-query {{nominatimArea:Germany}} into="area"/> | |
<union> | |
<query type="way"> | |
<has-kv k="highway" v="motorway"/> | |
<area-query from="area"/> | |
</query> | |
</union> | |
<union> | |
<item /> |
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
// Results in ▓▓▓▓▓▓▓▓▓▓░░░░░░░░░ | |
WIEDERHOLEN("▓";GANZZAHL(E2÷C2×20)) & WIEDERHOLEN("░";GANZZAHL((1−E2÷C2)×20)) | |
// Inspired by https://twitter.com/year_progress/status/881482588732477440 | |
// Script adapted from https://strobelstefan.org/?p=4126 |
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
<input type="range" min="-180" max="180" step="0.1" oninput="update(this.value)" onchange="update(this.value)"> |
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
python3 -m http.server |
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 src='https://npmcdn.com/@turf/turf/turf.min.js'></script> | |
<script> | |
var lineString = { | |
"type": "Feature", | |
"properties": {}, | |
"geometry": { | |
"type": "LineString", | |
"coordinates": [ | |
[ | |
13.0078125, |
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 src="socket.io.min.js"></script> | |
<script> | |
var ipOfLaptop = '192.168.2.107'; | |
var definedPort = 8123; | |
var host = 'http://' + ipOfLaptop + ':' + definedPort; | |
var socket = io(host); | |
socket.emit('msg', 'test'); | |
</script> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
// import | |
// - https://d3js.org/d3-geo.v1.min.js | |
// - https://d3js.org/d3-geo-projection.v2.min.js | |
// Keep x and y in the same range of values as coordinates | |
var x = 180; | |
var y = 90; | |
var fromXY = [x, y]; | |
var fromLonLat = d3.geoEquirectangular().invert(fromXY); | |
var toXY = d3.geoMercator()(fromLonLat); |
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
<div id="console"> | |
Press a key to see its key code | |
</div> | |
<script> | |
var cnsl = document.getElementById('console'); | |
document.addEventListener("keyup", function(){ | |
cnsl.innerHTML = event.keyCode; | |
}); | |
</script> |
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 getAngleBetweenVectorAndPlane(vector, plane) { | |
var angle = Math.asin(Math.abs(plane.x * vector.x + plane.y * vector.y + plane.z * vector.z) / (Math.sqrt(Math.pow(plane.x, 2) + Math.pow(plane.y, 2) + Math.pow(plane.z, 2)) * Math.sqrt(Math.pow(vector.x, 2) + Math.pow(vector.y, 2) + Math.pow(vector.z, 2)))); | |
// http://www.vitutor.com/geometry/distance/line_plane.html | |
var direction = -vector.z / Math.abs(vector.z); // Because vector angle is always shortest and has no direction | |
angle = angle * direction * 180 / Math.PI; | |
return angle; | |
} |