See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| package main | |
| import ( | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "crypto/rand" | |
| "encoding/base64" | |
| "errors" | |
| "io" | |
| "log" |
| /* | |
| Watch out, os.IsExist(err) != !os.IsNotExist(err) | |
| They are error checkers, so use them only when err != nil, and you want to handle | |
| specific errors in a different way! | |
| Their main purpose is to wrap around OS error messages for you, so you don't have to test | |
| for Windows/Unix/Mobile/other OS error messages for "file exists/directory exists" and | |
| "file does not exist/directory does not exist" |
| watchman watch-del-all && rm -rf node_modules/ && yarn cache clean && yarn install && yarn start -- --reset-cache |
Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".
Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).
Let's dig in:
| // This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally | |
| package main | |
| import ( | |
| "crypto/rand" | |
| "crypto/rsa" | |
| "crypto/x509" | |
| "encoding/pem" | |
| "golang.org/x/crypto/ssh" |
A quick cheatsheet of useful snippet for Flutter
A widget is the basic type of controller in Flutter Material.
There are two type of basic Widget we can extend our classes: StatefulWidget or StatelessWidget.
StatefulWidget are all the widget that interally have a dynamic value that can change during usage. It can receive an input value in the constructor or reference to functions. You need to create two classes like:
| { | |
| "workbench.startupEditor": "newUntitledFile", | |
| "editor.fontSize": 16, | |
| "editor.lineHeight": 1.8, | |
| "javascript.suggest.autoImports": true, | |
| "javascript.updateImportsOnFileMove.enabled": "always", | |
| "editor.rulers": [ | |
| 80, | |
| 120 | |
| ], |
| <h1 align="center"> | |
| <br> | |
| <img src="YOUR_LOGO_URL" alt="YOUR_PROJECT_NAME" width="120"> | |
| <br> | |
| <br> | |
| YOUR_PROJECT_NAME | |
| </h1> | |
| <p align="center">A little description about your project</p> |
| <h1 align="center"> | |
| <br> | |
| <img src="YOUR_LOGO_URL" alt="YOUR_PROJECT_NAME" width="120"> | |
| <br> | |
| <br> | |
| YOUR_PROJECT_NAME | |
| </h1> | |
| <p align="center">A little description about your project</p> |