johnniecoder (@johnniecoder) header
johnniecoder (@johnniecoder) profile picture

coder

Hong Kong
Joined August 2016
johnniecoder retweeted
10 best Go resources in my bookmarks. Read just one and you’re in good shape: 1. Go Concurrency Rocks: concurrency.rocks 2. Go Cookbook: go-cookbook.com 3. 100 Go Mistakes and How to Avoid Them: 100go.co 4. Practical Go Lessons: practical-go-lessons.com 5. Common Performance Patterns: goperf.dev/01-common-pattern… 6. Practical Networking Patterns: goperf.dev/02-networking/ 7. Learn Go with Tests: quii.gitbook.io/learn-go-wit… 8. Guide to Go Profiling, Tracing and Observability: github.com/DataDog/go-profil… 9. Go Class: youtube.com/playlist?list=PL… 10. Go Roadmap: roadmap.sh/golang Bonus: 11. Go at VictoriaMetrics series: victoriametrics.com/blog/cat… 12. Go Practical Tips (by me): github.com/func25/go-practic…
8
121
4
671
33,438
Speed Secrets! You don’t lack potential… You may just lack key information. At least I know I did for the first 10 years of my speed journey. I was told by family, coaches, peers…that I was not meant to be fast. They believed that my body wasn’t designed to be athletic. Videos of me at 14 make it understandable why they thought this. Frail, underweight, short and injured. Still, one key thing was massively overlooked. That being the human body’s incredible capacity to ADAPT. With intentional & consistent training, you can develop the many of the qualities that the genetic freak athletes may have started with. While this is great, there is another challenge in planning your athletic transformation. You must figure out 👇 What qualities are possessed by the fastest athletes? AND How do you best train for these qualities? After years of seeking the answer to these questions, I’ve gained a good understanding on what I was missing when I was 14. Here are the 5 keys to speed development, that I wish someone told me earlier 🏃‍♂️💨
2
5
61
8,675
He built STRONG ABS with science!
14
967
14
8,657
893,479
Functional Options Pattern in Go The functional options pattern in #golang offers a flexible and readable way to configure structs without exposing internal fields. It is particularly useful when you want to provide optional configuration and there may be more configuration options in the future. It's great for libraries! Let's see an example. Here is a super basic server without functional options: Let's imagine that over time, our requirements change, and we need to support more configuration options. Instead of changing the signature of the NewServer function, which can be problematic and not backward-compatible, we can use functional options. Firstly we define a functional option of type: ServerOption func(*Server) and write a function that satisfies the type: modify our new server function: and now we can use it like this: As you can see, this allows us to offer customisations flexibly, whilst still maintaining readability and not exposing internal fields. My biggest tip; make sure that your functional options are truly optional. You'll notice in my example that if I do not pass in withPort(), my newServer functional returns a server with a sensible default configuration. This is good practise and I have found this patterns work best for things that are truly optional. Hope you found this useful!
12
48
309
24,195
SQL Interviews Questions & Answer You Should Know : 👇 [Bookmark For Future Reference] 🧵
28
560
2,058
367,698
Instead of spending $200,000 on my MBA, I wish I would've read these 10 books:
58
582
16
1,953
johnniecoder retweeted
I've built 5 Shopify Apps. And it makes me $340K+ per year. So if you're interested in Shopify Apps Here is my perfect process for launching a new app 🧵👇
76
290
19
2,235
johnniecoder retweeted
Google Sheets isn't Excel. But it's more powerful than you think. 10 things Sheets can do, you'll wish you knew yesterday: 📊
521
10,010
375
36,529
johnniecoder retweeted
⚡CSS CheatSheet⚡ 💡10 Ways to center a div💡
44
285
14
1,314
johnniecoder retweeted
22 cognitive biases you can learn in 30 seconds to make 100x better decisions:
37
729
27
2,647
📌 React’s 6 main hooks explained - web development with react just got easier 🧵👇
59
343
8
1,549
Developer rituals before the production release 😂 Remember, Don’t deploy on Friday! 😎
336
2,187
536
12,529
johnniecoder retweeted
My friends, a new MEGATHREAD has arrived! In 40 tweets I’ll explain 40 useful concepts you should know. Reading time: ~7 minutes. Value: a lifetime. Thread:
799
9,642
841
38,466
johnniecoder retweeted
How old were you when you discovered that holding the shift key while hovering over a request on Chrome DevTools will highlight the initiator in green and dependencies in red? 😱 Thanks, @addyosmani, for the tip!
137
1,438
149
8,111
12 Docker Threads. · Why Containers? 1/2 · Why Containers? 2/2 · Path to learn Docker · 11 Fundamental Definitions · Docker Architecture · Docker run · Dockerfile · Docker Compose · Env Variables in Docker · Containers' lifecycle · OSS projects · Is K8s deprecating Docker? ↓
42
345
10
1,368
johnniecoder retweeted
Companies use pricing psychology to trick you into spending more. Here are 10 pricing secrets you can use to your advantage...
60
1,137
56
5,011
You can write great code in any framework. You can write terrible code in any framework. The quality of your code has more to do with your emphasis on quality than the framework.
19
187
12
915
johnniecoder retweeted
"Just Train your ML model in Docker."
43
227
53
2,106
9 Best Movies About Self-Growth 👇 1. Into The Wild
9
520
13
1,885