Skip to content

Instantly share code, notes, and snippets.

View chhpt's full-sized avatar
:octocat:
On the way

chhpt chhpt

:octocat:
On the way
View GitHub Profile
@chhpt
chhpt / auth.js
Created August 16, 2019 08:27
CloudV3
import fetch from 'node-fetch'
import crypto from 'crypto'
import QueryString from 'query-string'
import HttpsProxyAgent from 'https-proxy-agent'
import tencentcloud from '../../deps/tencentcloud-sdk-nodejs'
import { TcbError } from '../error'
import { getCredential } from './index'
import { AuthSecret } from '../types'
@chhpt
chhpt / uuid.js
Last active January 3, 2024 02:52
生成 uuid
function uuidv4() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
console.log(uuidv4())
@chhpt
chhpt / emoji.md
Created October 8, 2018 04:21
Github emoji

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@chhpt
chhpt / scrollbar.scss
Created May 13, 2018 07:17
滚动条自定义
@mixin thinScrollBar {
&::-webkit-scrollbar {
visibility: hidden;
width: 0.4rem;
height: 0.4rem;
border: 1px solid $border-color;
}
// &:hover::-webkit-scrollbar {
// visibility: visible;
@chhpt
chhpt / traffic1.js
Created March 29, 2018 07:59
实现交通灯的顺序变化
// 实现较好的封装
const traffic = document.getElementById('traffic');
function start(traffic, statelist) {
var currentStateIndex = 0;
setinterval(function() {
var state = statelist[currentstateindex];
traffic.className = state;
currentStateIndex = (currentStateIndex + 1) % stateList.length;
@chhpt
chhpt / list.html
Last active March 29, 2018 06:30
实现点击文字控制 radio 状态
<ul>
<li>
<input name="item" id="item1" type="radio" value="张三">
<label for="item1">张三</label>
</li>
<li>
<input name="item" id="item2" type="radio" value="李四">
<label for="item2">李四</label>
</li>
<li>