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
| /* 前提需要先引入three.js | |
| * n —— 正多边形边数 | |
| * r —— 正多边形所在外接圆的半径 | |
| * cx —— 正多边形所在外接圆的圆形X轴坐标(默认为:0) | |
| * cy —— 正多边形所在外接圆的圆形Y轴坐标(默认为:0) | |
| */ | |
| function drawPolygon(n ,r, cx = 0, cy = 0) { | |
| let vertexs = []; | |
| for(let i=0; i<n; i++) { | |
| let x = cx + r*Math.sin(2*Math.PI/n*i); |
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 gulp = require("gulp"); | |
| const spritesmith = require("gulp.spritesmith"); // https://github.com/twolfson/gulp.spritesmith | |
| const imagemin = require('gulp-imagemin'); | |
| const concat = require('gulp-concat'); | |
| const uglify = require('gulp-uglify'); | |
| const rename = require('gulp-rename'); | |
| const sass = require('gulp-sass'); | |
| // 默认任务 | |
| gulp.task('default', function () { |
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 webpack = require("webpack"); | |
| const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
| module.exports = { | |
| baseUrl: "/", | |
| outputDir: "dist", | |
| // 打包之后静态资源保存的目录 | |
| assetsDir: "assets", | |
| // 配置多页引用的入口 | |
| pages: { |
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 webpack = require("webpack") | |
| module.exports = { | |
| baseUrl: "/", | |
| outputDir: "dist", | |
| // 打包之后静态资源保存的目录 | |
| assetsDir: "assets", | |
| // 配置多页引用的入口 | |
| pages: { | |
| index: "src/main.js", |
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
| git init # 初始化本地git仓库(创建新仓库) | |
| git config --global user.name "xxx" # 配置用户名 | |
| git config --global user.email "xxx@xxx.com" # 配置邮件 | |
| git config --global color.ui true # git status等命令自动着色 | |
| git config --global color.status auto | |
| git config --global color.diff auto | |
| git config --global color.branch auto | |
| git config --global color.interactive auto | |
| git config --global --unset http.proxy # remove proxy configuration on git | |
| git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库 |
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
| vi ~/.bash_profile | |
| export JAVA_8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home | |
| export JAVA_9_HOME=/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home | |
| export JAVA_HOME=$JAVA_8_HOME | |
| source ~/.bash-profile |
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 clone(obj) { | |
| if ((typeof (obj) == "object") && (obj != null)) { | |
| if (obj instanceof Array) { | |
| //如果是Array | |
| let newObj = []; | |
| for (let i = 0; i < obj.length; i++) { | |
| if (typeof (obj[i]) == "object") { | |
| newObj[i] = clone(obj[i]); | |
| } else { | |
| newObj[i] = obj[i]; |
NewerOlder