Skip to content

Instantly share code, notes, and snippets.

View holocc's full-sized avatar
🎯
Focusing

yahaha holocc

🎯
Focusing
  • BD
  • Beijing
View GitHub Profile
@holocc
holocc / index.html
Created May 9, 2020 09:29
点击穿透
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style type="text/css">
.button {
background: red;
height: 300px;
@holocc
holocc / push.js
Created March 10, 2020 12:42
a http2 push demo
const http2 = require('http2')
const fs = require('fs')
const privatekey = fs.readFileSync('./certificate/private.pem', 'utf8')
const certificate = fs.readFileSync('./certificate/csr.crt', 'utf8')
const server = http2.createSecureServer({
key: privatekey,
cert: certificate
}, function (req, res) {
res.stream.pushStream({ ':path': '/b.js' }, (err, pushStream, headers) => {
@holocc
holocc / v1.js
Created April 10, 2019 15:08
vue observe demo
const data = {}
let a = 1
let dep = []
let Target = null
Object.defineProperty(data, 'a', {
set: function(val) {
a = val
dep.forEach(fn => fn())