Skip to content

Instantly share code, notes, and snippets.

View tommady's full-sized avatar
🤪
✌🏻( ᐛ )✌🏻

tommady tommady

🤪
✌🏻( ᐛ )✌🏻
  • 127.0.0.1
View GitHub Profile
@tommady
tommady / README.md
Last active June 14, 2021 10:01
Leetcode simple bash crawler without login #post

I just wrote a simple bash code to crawling leetcode's

  1. code definition
  2. question frontend id
  3. content
  4. example testcases

and then template them into a rust file

I know there has much more I can enhanced,

@tommady
tommady / README.md
Created January 2, 2021 12:38
Rust HashMap with Traits #post

I was trying to use this lib

this lib is cool that can help you to calculate financing indicators, and it used a beautiful way to present the incoming value of an indicator: a Next trait

so after some coding the code looks like

let mut ema5 = EMA::new(5)?;
let mut ema7 = EMA::new(7)?;
let mut ema10 = EMA::new(10)?;
@tommady
tommady / README.md
Created November 18, 2020 12:45
First time build a deb file in Rust #post

Recentlly, I got an oppertunity to have an interview process of Canonical Taipei, the take-home task is very interesting for me, since I am a backend engineer.

the task I'll not gonna describe in here but it takes me come to an idea: what if I try to build a deb file in Rust?

the launchpad aka sudo apt install XDDD

this building system is very secure, you don't have internet while building, and currently the cargo or rustup still cannot be installed by apt command.

@tommady
tommady / README.md
Last active November 15, 2020 19:50
Using Gist as Blog #post

Since I researching a lot of solutions of how to create a blog, there are a lot of resources shows howto do this task,

  1. static generic html from markdown (Hugo, Jekyll...etc)
  2. build your own blog service
  3. using gist as blog engine
  4. rendering your gist in a third party website (gist.io, bl.ocks.org...etc)

I choice the third one, because I think this one is the simplest one and you just using the gist as the database, your posts never gone away and centrolized in gist only.

@tommady
tommady / README.md
Last active November 14, 2020 12:02
golang batch processing with flush out within a time limit #post
@tommady
tommady / gRPC_generic_type_in_Golang.md
Last active November 14, 2020 12:02
gRPC generic type in Golang #post
package channelSwap
import (
"sync"
"time"
)
type Batcher struct {
cb cb
threshold int
package sliceSwap
import (
"sync"
"time"
)
type Batcher struct {
cb cb
threshold int
package slice
import (
"sync"
"time"
)
type Batcher struct {
cb cb
threshold int
req.Arg = &structpb.Value{Kind: &structpb.Value_StringValue{StringValue: "string"}}
r, err := c.DoSomething(context.Background(), req)