Skip to content

Instantly share code, notes, and snippets.

View YanceyOfficial's full-sized avatar
🎯
Focusing

Yancey Leo YanceyOfficial

🎯
Focusing
View GitHub Profile
@YanceyOfficial
YanceyOfficial / tls-handshake.md
Last active March 27, 2022 16:12
TLS 握手小结

SSL 握手过程

只验证服务器的 SSL 握手过程

1. Client Hello

SSL 客户端通过 Client Hello 消息向 SSL 服务端发送:

  • 支持的 SSL 版本
  • 客户端生成的一个用于生成主密钥(master key)的 32 字节的随机数(主密钥由客户端和服务端的随机数共同生成)
@YanceyOfficial
YanceyOfficial / WebP能力检测.js
Created July 21, 2020 06:10
WebP 能力检测 by Modernizr
/*! modernizr 3.6.0 (Custom Build) | MIT *
* https://modernizr.com/download/?-webp-setclasses !*/
!function(e,n,A){function o(e,n){return typeof e===n}function t(){var e,n,A,t,a,i,l;for(var f in r)if(r.hasOwnProperty(f)){if(e=[],n=r[f],n.name&&(e.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(A=0;A<n.options.aliases.length;A++)e.push(n.options.aliases[A].toLowerCase());for(t=o(n.fn,"function")?n.fn():n.fn,a=0;a<e.length;a++)i=e[a],l=i.split("."),1===l.length?Modernizr[l[0]]=t:(!Modernizr[l[0]]||Modernizr[l[0]]instanceof Boolean||(Modernizr[l[0]]=new Boolean(Modernizr[l[0]])),Modernizr[l[0]][l[1]]=t),s.push((t?"":"no-")+l.join("-"))}}function a(e){var n=u.className,A=Modernizr._config.classPrefix||"";if(c&&(n=n.baseVal),Modernizr._config.enableJSClass){var o=new RegExp("(^|\\s)"+A+"no-js(\\s|$)");n=n.replace(o,"$1"+A+"js$2")}Modernizr._config.enableClasses&&(n+=" "+A+e.join(" "+A),c?u.className.baseVal=n:u.className=n)}function i(e,n){if("object"==typeof e)for(var A in
import axios, { AxiosError, AxiosResponse, AxiosRequestConfig } from 'axios'
import { Observable } from 'rxjs'
const { CancelToken } = axios
// config timeout
axios.defaults.timeout = 30 * 1000
// config cookie
// axios.defaults.withCredentials = true;
enum Direction {
  Up = 1,
  Down,
  Left,
  Right
}
@YanceyOfficial
YanceyOfficial / fe_pagination_search.vue
Last active May 17, 2019 03:13
Vue + Element UI Table + TypeScript + 前端分页 + 前端模糊查询
<template lang='pug'>
.wrapper
el-input(
placeholder='请输入检索条件'
prefix-icon='el-icon-search',
v-model='searchValue',
)
el-table(
:data='tables.slice((curPage - 1) * curPageSize, curPage * curPageSize)',
stripe,
@YanceyOfficial
YanceyOfficial / ws.vue
Created April 15, 2019 09:07
[demo] sock.js + stomp.js
<template lang="pug">
SomeComponent(:data="data")
</template>
<script lang="ts">
import Vue from 'vue';
import Component from 'vue-class-component';
import { Watch } from 'vue-property-decorator';
import SockJS from 'sockjs-client';
import Stomp from 'stompjs';
@YanceyOfficial
YanceyOfficial / BOM.js
Created March 19, 2019 10:05
BOM一些好玩的东西
// 全屏/关闭全屏
document.documentElement.requestFullscreen.call(document.documentElement)
document.webkitCancelFullScreen.call(document)
@YanceyOfficial
YanceyOfficial / license-badges.md
Created March 9, 2019 12:28 — forked from lukas-h/license-badges.md
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

@YanceyOfficial
YanceyOfficial / App.js
Last active January 28, 2019 09:31
[源码] 尝试创建一个React通用UI组件
import React, { Component } from 'react';
import Button from './components/Button/Button';
import { useState } from 'react';
import { library } from '@fortawesome/fontawesome-svg-core';
import {
faSpinner,
faTrashAlt,
faSave,
} from '@fortawesome/free-solid-svg-icons';
@YanceyOfficial
YanceyOfficial / robot.html
Created January 25, 2019 16:32
调戏图灵机器人
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Robot</title>
<style>
#feedback{
display: flex;
flex-direction: column;