This file contains hidden or 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
| cd "${0%/*}" | |
| cat > "app.js" <<- EOM | |
| const https = require('https'); | |
| const fs = require('fs'); | |
| const options = { | |
| key: fs.readFileSync('key.pem'), | |
| cert: fs.readFileSync('cert.pem') | |
| }; |
This file contains hidden or 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
| <meta charset="utf-8"> | |
| <title>MediaRecorder</title> | |
| <script> | |
| function newhtml(tag,attributes,ths) { | |
| var rv = document.createElement(tag); | |
| for (var x in attributes) { | |
| if (x!="style") rv[x] = attributes[x]; | |
| else { | |
| for (var s in attributes[x]) { |
This file contains hidden or 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
| async function upload(canvas,url) { | |
| let blob = await (new Promise(resolve => canvas.toBlob(resolve))); | |
| try { | |
| const response = await fetch(url, | |
| { | |
| method:'POST', | |
| headers:{ | |
| 'Content-Type':'application/octet-stream' | |
| }, | |
| body:blob |
This file contains hidden or 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
| window.speechSynthesis.speak(new SpeechSynthesisUtterance("From fairest creatures we desire increase, That thereby beauty's rose might never die, But as the ripershould by time decease,His tender heir might bear his memory")); |
This file contains hidden or 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
| <html> | |
| <head> | |
| <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.0.0/dist/tf.min.js"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-vis@1.0.2/dist/tfjs-vis.umd.min.js"></script> | |
| <script> | |
| function plot(x,y,z) { | |
| var [x_,y_,z_] = [x,y,z||y].map( (t)=>t.arraySync() ); | |
| var p = x_.map(function(x__,i){return {x:x__,y:y_[i]} }); | |
| var p1 = x_.map(function(x__,i){return {x:x__,y:z_[i]} }); | |
| tfvis.render.scatterplot({name:"",tab:'Charts'},{values:[p,p1]}); |
This file contains hidden or 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
| #update nodejs | |
| sudo npm cache clean -f | |
| sudo npm install -g n | |
| sudo n stable | |
| #macos python -> ssh -> win10 | |
| cat helloworld.py | ssh username@192.168.1.4 python - | |
| #all webm to mp4 | |
| for f in *.webm; do ffmpeg -fflags +genpts -i "$f" -r 24 "$f.mp4"; done |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <script type="text/javascript"> | |
| function ascript(src){ | |
| return new Promise((resolve, reject) => { | |
| let script2 = document.createElement('script'); | |
| script2.async = true; |
This file contains hidden or 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
| cd %~dp0 | |
| "%PROGRAMFILES(X86)%\Google\Chrome\Application\chrome.exe" --app=http://localhost:8000/index.html | node.exe server.js | |
| pause |
This file contains hidden or 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
| <!DOCTYPE HTML> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <script id="vshader" type="VERTEX_SHADER"> | |
| uniform mat4 position; | |
| uniform mat4 camera; | |
| attribute vec3 aVertexPosition; | |
| void main() { | |
| gl_Position = position * camera * vec4(aVertexPosition, 0.9); |
This file contains hidden or 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
| #setup router as '192.168.1.200' in router settings | |
| uci set network.lan.ipaddr='192.168.1.1' | |
| uci set network.lan.gateway='192.168.1.200' | |
| uci set network.lan.dns='8.8.8.8' | |
| uci commit && service network restart |