首页
  • go-gin框架基本接口

    package main
    
    import (
        "fmt"
        "github.com/gin-gonic/gin"
        "net/http"
    )
    
    type User struct {
        Name string `json:"name"`
        Age  int    `json:"age"`
    }
    
    func main() {
    
        r := gin.Default()
    
    阅读全文
  • npm 切换淘宝源和npm源

    
    npm install -g nrm 
    
    nrm use taobao
    
    nrm use npm
    
    阅读全文
  • npm 自建 包

    新建本地目录文件夹,初始化

    // 新建文件夹 然后
    npm init

    新建index.js

    function hello( name ){
        console.log( "hello" + name )
    }
    exports.hello = hello

    登陆npm账户 登陆和发布需要切换到npm官方源,见下↓

    npm adduser
    阅读全文
  • go 学习 包的导出

    | - src
        - index.go
        - libs
            - index.go

    libs / index.go

    package libs // 属于哪个包
    //  方法名 首字母 大写才能导出
    func Count( a int, b int ) int {
        return a + b
    }
    

    index.go

    阅读全文
  • go 学习 hello world

    文件index.go

    // 定义包名 每个go程序都必须包含一个main的包名,表示一个可以独立执行的程序
    package main
    
    // 导入包名 告诉 go程序 需要的使用的包名称
    import "fmt"
    
    // 必须包含的 main 主函数
    func main() {
        fmt.Println("Hello, World!")
    }
    阅读全文
  • react 添加代理 proxy

    react package.json中proxy的配置如下

    "proxy": {
        "/api/rjwl": {
          "target": "http://47.94.142.215:8081",
          "changeOrigin": true
        }
    }

    报错:

    阅读全文
  • python 将视频转换成音频

    安装库

    sudo pip install moviepy

    代码 index.py

    from moviepy.editor import *
    
    video = VideoFileClip('test.mp4')
    audio = video.audio
    audio.write_audiofile('test.mp3')

    运行

    阅读全文
  • react 添加 react-redux 基本用法

    安装

    yarn add react-redux

    创建文件、文件夹

    |- redux
      |- actions.js
      |- reducer.js
      |- store.js

    actions.js

    
    export const change_user_info = "changeUserInfo"
    
    阅读全文
  • react使用typeScript,props、state 类型定义

    1. props state 类型定义
    2. input 事件 event 类型定义
    // 定义 Props 类型
    export interface Props { 
        name: string;
        value: string; 
    }
    // 定义 State 类型
    export interface State{
        value: string;
    }
    阅读全文
  • 初始化项目配置的几个隐藏文件

    .editorconfig 编辑器配置缩进等

    root = true
    end_of_line = lf
    insert_final_newline = true
    charset = utf-8
    indent_style = space
    indent_size = 4

    .babelrc babel编辑配置

    {
    阅读全文
  • 上一页 1 2 3 4 5 6 7 8 9 下一页
Taoqun
陶群
1994-09-07
taoquns@foxmail.com
前端开发
南京

文章分类

Mac
算法
前端
python
golang
mysql
node
linux
随笔
生活
游记

我的作品

记录体重Pro(小程序)
闲蝉科技

其他推荐

2018-10-31
Mac打开应用提示已损坏怎么办 开启 任何来源
nginx 常规命令操作
python 将视频转换成音频
go 学习 包的导出
npm canvas 安装失败
leetCode 取中位数
开发者:Taoqun

备案/许可证编号为:皖ICP备17027395号

闲蝉科技