Skip to content

Instantly share code, notes, and snippets.

View aimuz's full-sized avatar
👀
I am actively seeking job opportunities in the field of cloud-native technologie

aimuz aimuz

👀
I am actively seeking job opportunities in the field of cloud-native technologie
View GitHub Profile
@aimuz
aimuz / deno_static_file_server.ts
Last active February 11, 2023 08:42 — forked from mayankchoubey/deno_static_file_server.ts
Deno static file server
import { serve } from "https://deno.land/std/http/mod.ts";
import { lookup } from "https://deno.land/x/media_types/mod.ts";
const BASE_PATH = "";
const reqHandler = async (req: Request) => {
const filePath = BASE_PATH + new URL(req.url).pathname;
let fileSize;
try {
fileSize = (await Deno.stat(filePath)).size;
@aimuz
aimuz / sign.go
Created August 28, 2020 12:58
Generate the corresponding pre signature string according to the object
package sign
import (
"reflect"
"sort"
"strconv"
"strings"
)
// GeneratePreSign from objects generates a pre-signed message
@aimuz
aimuz / .aliasrc
Last active December 24, 2020 02:52
# vscode 打开当前目录
alias vsc='code "$PWD"'
# goland 打开当前目录
alias god='goland "$PWD"'
# 打开 git repo
alias gop="git open"
# 格式化Go项目代码
@aimuz
aimuz / fork-and-push.md
Created January 23, 2019 03:47 — forked from zxhfighter/fork-and-push.md
如何给开源项目贡献代码

如何给开源项目贡献代码

分两种情况:

  • 代码仓库管理者给你添加该仓库的写入权限,这样的话可以直接push
  • 如果不能直接push(大多数情况),采用经典的fork & pull request来提交代码,下面讲述这种情况

fork & pull request

例如有个仓库https://github.com/ecomfe/esui.git,其采用了经典的分支开发模型,稳定后的代码提交到master分支,其余特性则在dev分支上进行开发,待成熟后合并回master分支。

@aimuz
aimuz / dom.js
Created November 7, 2018 03:04
虚拟dom 生成实体dom
var domNode = {
tagName: "ul",
props: { class: "list" },
children: [{
tagName: "li",
children: ["1"],
}, {
tagName: "li",
children: ["2"],
}, {
{
"read": "2018-10-19T09:54:05.6070482Z",
"preread": "2018-10-19T09:54:04.6044412Z",
"pids_stats": {
"current": 1
},
"blkio_stats": {
"io_service_bytes_recursive": [
{
"major": 8,
goimports -w -l $(find . -type f -name '*.go' -not -path "./vendor/*")
@aimuz
aimuz / main.go
Created July 10, 2018 06:57
反射获取类型,并且动态创建
package main
import (
"fmt"
"reflect"
)
type My struct {
Name string
Id int