这是我常用的 fab 部署脚本的改写通用版本。
可能对大型项目没起作用,但是对于小项目,作用还是很大,所以发出来写个文章分享下。
const healthExamObj = { | |
// begin_time: 0, | |
// end_time: 999999999999, | |
exam_id: 1, | |
issues: [ | |
{ | |
key: 'name', // 后面我想直接去掉这个 key ,不过如果只用 issue_id 的话,不可读,麻烦。 | |
issue_id: 0, | |
title: '姓名', | |
type: 'input', |
import './global'; | |
import debugAdd, { globalAdd } from './debug'; | |
App({ | |
// ........ 一大堆的东西 | |
}); | |
const app = getApp(); | |
debugAdd('app', app); // 直接控制台 console 那边 debugAddSave.app 查看内存 |
/* dateStr 的格式为'2018-11-25 16:14:24' */ | |
function getDateDiff(dateStr) { | |
var publishTime = getDateTimeStamp(dateStr) / 1000, | |
d_seconds, | |
d_minutes, | |
d_hours, | |
d_days, | |
timeNow = parseInt(new Date().getTime() / 1000), | |
d, |
// 文件名应该是 object_each.wxs , github 上没法识别,所以直接用 js 后缀,如果name 中含有 " 引号,那就洗洗睡吧,不适合这样的业务。 | |
// 匹配 key 的 regex | |
var keyRe = getRegExp('"[^"]+":', 'img'); | |
// 匹配 name 替换的 regex | |
var replaceRe = getRegExp('[":]', 'img'); | |
var objectEntries = function (target) { | |
var entries = []; | |
var targetString = JSON.stringify(target); |
<!DOCTYPE html> | |
<html lang="en"> | |
<body> | |
<style> | |
.percentage-box { | |
box-sizing: border-box; | |
width: 210px; | |
height: 210px; | |
position: relative; | |
background-color: #ff6e00; |
const onDownload = (link) => { | |
const tempLink = document.createElement('a'); | |
tempLink.href = link; | |
tempLink.setAttribute('download', 'img.png'); | |
tempLink.setAttribute('target', '_blank'); | |
document.body.appendChild(tempLink); | |
setTimeout(() => { | |
tempLink.setAttribute('download', 'qrcode.png'); | |
tempLink.click(); | |
document.body.removeChild(tempLink); |
#!/bin/bash | |
# Check if user is root | |
if [ $(id -u) != "0" ]; then | |
printf "Error: You must be root to run this script!\n" | |
exit 1 | |
fi | |
echo "=========================================================================\n" | |
printf "Auto install net-speeder on your vps,written by tennfy \n" | |
printf "Version 0.1 \n" |