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
| const { execSync } = require('child_process'); | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const inputDir = './videos'; | |
| const outputDir = './outputVideos'; | |
| if (!fs.existsSync(outputDir)) fs.mkdirSync(outputDir); | |
| const files = fs.readdirSync(inputDir).filter((f) => f.endsWith('.mp4')); |
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"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"> | |
| <title>demo mobile</title> | |
| <style> | |
| .cont { | |
| height: 300px; |
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
| const http = require('http'); | |
| const cors = require('cors'); | |
| const fs = require('fs'); | |
| const PORT = 3000; | |
| const server = http.createServer(async (req, res) => { | |
| cors()(req, res, () => {}); | |
| if (req.url === '/stream-data' && req.method === 'GET') { |
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
| import { src, dest, watch, series, parallel } from 'gulp'; | |
| import babel from 'gulp-babel'; | |
| import jshint from 'gulp-jshint'; | |
| import ugilfy from 'gulp-uglify'; | |
| import rename from 'gulp-rename'; | |
| import browserSync from 'browser-sync'; | |
| import replace from 'gulp-replace'; | |
| import concat from 'gulp-concat'; | |
| import zip from 'gulp-zip'; | |
| // import sourcemaps from 'gulp-sourcemaps'; // 安装后 gulp 内置 |
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"> | |
| <title>first socket</title> | |
| </head> | |
| <body> | |
| <h1>myfitst room</h1> | |
| <input type="text" id="snedTxt" /> |
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
| function textEllipsis(eleClassName) { | |
| const eles = document.querySelectorAll(eleClassName); | |
| const formatStr = (ele) => { | |
| const text = ele.innerHTML; | |
| const totalTextLen = text.length; | |
| const lineNum = 3; | |
| const baseWidth = window.getComputedStyle(ele).width; | |
| const baseFontSize = window.getComputedStyle(ele).fontSize; | |
| const lineWidth = +baseWidth.slice(0, -2); // 去除单位 |