Git Product home page Git Product logo

gool's Introduction

Gool

Test Lint Deploy codecov Go Report Card

A toolkit make your programmer life easier.

Inspired by Boop

demo

Installation

Homebrew

brew install cloudingcity/tap/gool

Docker

docker run --rm -it ghost0436/gool

Usage

$ gool jwt-decode eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
{
  "header": {
    "alg": "HS256",
    "typ": "JWT"
  },
  "payload": {
    "sub": "1234567890",
    "name": "John Doe",
    "iat": 1516239022
  },
  "signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}

Gool Shell

$ gool shell 
Gool Shell
\h: show help
=# \s jwt-decode
jwt-decode=# eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
{
  "header": {
    "alg": "HS256",
    "typ": "JWT"
  },
  "payload": {
    "sub": "1234567890",
    "name": "John Doe",
    "iat": 1516239022
  },
  "signature": "SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
jwt-decode=#

Scripts

Script Description
timestamp-to-date, t2d Covert unix timestamp to date
date-to-timestamp, d2t Covert date to unix timestamp
jwt-decode Decode JWT
md5 Computes the checksum
url-encode Encode url
url-decode Decode url
rand-string Generate random string of given length (characters: a-z, A-Z, 0-9)
count Get the characters length
camel-case Coverts string to camel case
kebab-case Coverts string to kebab case
lower-case Coverts string to lower case
snake-case Coverts string to snake case
start-case Coverts string to start case
upper-case Coverts string to upper case

Library

package main

import (
	"fmt"

	"github.com/cloudingcity/gool/pkg/cases"
	"github.com/cloudingcity/gool/pkg/date"
	"github.com/cloudingcity/gool/pkg/timestamp"
)

func main() {
	fmt.Println(cases.Snake("HelloWorld"))
	// hello_world

	fmt.Println(cases.Camel("hello world"))
	// helloWorld

	fmt.Println(date.ToTimestamp("2020-09-01"))
	// 1598918400 <nil>
	
	fmt.Println(timestamp.ToDate(1598918400))
	// 2020-09-01 08:00:00 +0800 CST
}

gool's People

Contributors

cloudingcity avatar livekn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.