Skip to content

Instantly share code, notes, and snippets.

View lipengzhou's full-sized avatar
🏠
Working from home

LPZ lipengzhou

🏠
Working from home
  • Beijing, China
View GitHub Profile
function getLatestWeekDate(date) {
const weekOfDay = moment(date).format('E'); // 指定日期的周的第几天
const unitOfTime = 'days'
const lastMonday = moment(date)
.subtract(weekOfDay - 1, unitOfTime)
.format('YYYY-MM-DD'); // 周一日期
const lastTuesday = moment(date)
.subtract(weekOfDay - 2, unitOfTime)
.format('YYYY-MM-DD'); // 周二日期
const fs = require('fs')
const files = fs.readdirSync('./')
const trecFiles = files.filter(file => file.endsWith('.mp4'))
const start = 1
trecFiles.forEach((item, index) => {
let seq = start + index
@lipengzhou
lipengzhou / main.yml
Created June 22, 2020 11:59
GitHub Actions 部署 Nuxt 应用
name: Publish And Deploy Demo
on:
push:
tags:
- 'v*'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
@lipengzhou
lipengzhou / Web 切图.psw
Created May 10, 2020 05:22
适合前端开发者的 Photoshop 工作区配置
<?xml version="1.0" encoding="UTF-8"?>
<photoshop-workspace version="2.0">
<photoshop-panel-configuration>
<workspace version="1">
<dock anchor="top" content="control-bar" is-closed="false">
<control-bar id="1" origin="-15.2 -2.4" size="1519 33" is-closed="false" app-data="AAAAEAAAAAEAAAAAAABudWxsAAAAAgAAABdvd2xDb250ZW50Vmlld1N0cmluZ2lJRFRFWFQAAAAXAHAAYQBuAGUAbABpAGQALgBzAHQAYQB0AGkAYwAuAG8AcAB0AGkAbwBuAHMAAAAAABVvd2xDb250ZW50Vmlld0FwcERhdGFPYmpjAAAAAQAAAAAAAG51bGwAAAAA"/>
</dock>
<dock anchor="bottom" content="palette" is-closed="false">
<tab-pane mode="expanded" preferred-iconic-length="0" layout-mode="auto-flow">
<tab-group active-palette="2" is-closed="true">
@lipengzhou
lipengzhou / vue.json
Created February 28, 2020 15:30
VSC 代码段
{
// Place your snippets for vue here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@lipengzhou
lipengzhou / base.user.css
Last active March 18, 2020 12:03
Typora 主题编号
/**
* author: LPZ
* email: lpzmail@163.com
*/
h1, h2, h3, h4, strong {
font-weight: 600;
}
/* 添加自动序号样式 */
@ECHO OFF & PUSHD %~DP0 & TITLE
>NUL 2>&1 REG.exe query "HKU\S-1-5-19" || (
ECHO SET UAC = CreateObject^("Shell.Application"^) > "%TEMP%\Getadmin.vbs"
ECHO UAC.ShellExecute "%~f0", "%1", "", "runas", 1 >> "%TEMP%\Getadmin.vbs"
"%TEMP%\Getadmin.vbs"
DEL /f /q "%TEMP%\Getadmin.vbs" 2>NUL
Exit /b
)
SET /P ST=输入a添加右键菜单,输入d删除右键菜单:
if /I "%ST%"=="a" goto Add
@lipengzhou
lipengzhou / v-if实现.html
Last active March 12, 2019 08:38
模拟的v-if内部原理
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Vue 自定义指令模拟v-if</title>
<style>
.box {
width: 100px;
height: 100px;