Skip to content

Instantly share code, notes, and snippets.

View MHuiG's full-sized avatar
PIKAPIKA

H MHuiG

PIKAPIKA
View GitHub Profile
@MHuiG
MHuiG / gulpfile.js
Last active August 29, 2022 07:38
https://github.com/volantis-x/community/blob/main/gulpfile.js 20220829 (CSP Level 3 :Safari 15.4+ Chrome 59+ Firefox 58+ Edge 79+)
const gulp = require('gulp');
const cleanCSS = require('gulp-clean-css');
const htmlmin = require('gulp-html-minifier-terser');
const htmlclean = require('gulp-htmlclean');
const terser = require('gulp-terser');
const sourcemaps = require('gulp-sourcemaps');
const babel = require('gulp-babel');
// 压缩css文件
const minify_css = () => (
@MHuiG
MHuiG / gulpfile.js
Created August 25, 2022 05:53
blog/gulpfile.js
const gulp = require('gulp');
const cleanCSS = require('gulp-clean-css');
const htmlmin = require('gulp-html-minifier-terser');
const htmlclean = require('gulp-htmlclean');
const terser = require('gulp-terser');
const sourcemaps = require('gulp-sourcemaps');
// 压缩css文件
const minify_css = () => (
gulp.src(['./public/**/*.css','!./public/{lib,lib/**}','!./public/{libs,libs/**}','!./public/{media,media/**}'])
@MHuiG
MHuiG / sw.js
Created August 25, 2022 05:49
blog/source/sw.js
importScripts('https://cdn.jsdelivr.net/npm/workbox-cdn@5.1.3/workbox/workbox-sw.js');
workbox.setConfig({
modulePathPrefix: 'https://cdn.jsdelivr.net/npm/workbox-cdn@5.1.3/workbox/'
});
const { core, precaching, routing, strategies, expiration, cacheableResponse, backgroundSync } = workbox;
const { CacheFirst, NetworkFirst, NetworkOnly, StaleWhileRevalidate } = strategies;
const { ExpirationPlugin } = expiration;
const { CacheableResponsePlugin } = cacheableResponse;
@MHuiG
MHuiG / ohhAPI.js
Last active March 19, 2021 03:16
OHHHO APIPATH
async function handleRequest(request) {
const req = request;
const urlStr = req.url;
const urlObj = new URL(urlStr);
const path = urlObj.href.substr(urlObj.origin.length);
try {
if (path.startsWith("/")) {
if(request.method=="POST"){
let data=await request.json()
@MHuiG
MHuiG / keybase.md
Created November 13, 2020 00:51
keybase

Keybase proof

I hereby claim:

  • I am mhuig on github.
  • I am mhuig (https://keybase.io/mhuig) on keybase.
  • I have a public key whose fingerprint is 775C 83D6 7CBE 46A5 A18B 3D28 BA16 368B D4C4 169C

To claim this, I am signing this object:

@MHuiG
MHuiG / MiniValine individual CLA
Last active March 23, 2020 05:10
MiniValine individual CLA
### MiniValine Individual Contributor License Agreement
Thank you for your interest in contributing to open source software projects (“Projects”) made available by MiniValine or its affiliates (“MiniValine”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to MiniValine in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact thepie@foxmail.com.
You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.
**Copyright License.** You hereby grant, and agree to grant, to MiniValine a non-exclusive,