Skip to content

Instantly share code, notes, and snippets.

@rsgok
rsgok / axios.js
Created March 31, 2020 12:17
vue默认axios plugin的二次封装 添加config传入和token维护支持
"use strict";
import Vue from "vue";
import axios from "axios";
import router from "../router";
// Full config: https://github.com/axios/axios#request-config
// axios.defaults.baseURL = process.env.baseURL || process.env.apiUrl || '';
// axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
@rsgok
rsgok / index.html
Last active August 5, 2021 07:53
pure
<div id="root">
<!-- to be filled -->
</div>
@rsgok
rsgok / closure.js
Created November 26, 2020 13:36
一个可爱的闭包
// 闭包更加好嘛
// 就是新手看不懂了
const urls = {
getApp: '/api/app/get',
delApp: '/api/app/del'
}
const getAppList = reqWrapper((params) => request.get(urls.getApp, { params }), (res) => {
// ...
@rsgok
rsgok / curry.go
Created December 24, 2020 11:58
curry try
package strategy
import "code.byted.org/gopkg/logs"
type Executable interface {
Exec()
}
type Curry struct {
ExecIndex int
@rsgok
rsgok / proto3.md
Last active April 16, 2022 07:11
protobuf quick start

how to use protobuf

without any theory about serialization i will simply introduce how to quick start using protobuf in golang

step by step

prepare environment

download protobuf

Go 15 hrs 59 mins █████████████████▌░░░ 83.4%
Thrift 1 hr 31 mins █▋░░░░░░░░░░░░░░░░░░░ 8.0%
Other 41 mins ▊░░░░░░░░░░░░░░░░░░░░ 3.6%
JSON 32 mins ▌░░░░░░░░░░░░░░░░░░░░ 2.8%
Bash 10 mins ▏░░░░░░░░░░░░░░░░░░░░ 0.9%