Author: Website Admin

  • Vim: Insert Mode

    Pressing Ctrl-o in insert mode will turn Vim into normal mode for one set of command. Pressing Esc in insert mode will turn Vim into normal mode permanently.

  • Kubernetes: Node Cordon vs. Node Drain

    Node Cordon This will mark the node as unschedulable. New pod will not be scheduled to be deployed on this node. Existing pods still run on this node until the next reschedule. Node Uncordon This will mark the node as schedulable. Node Drain This will mark the node as unschedulable and at the same time…

  • Golang: HTTP Testing

    HTTP GET Run it with: HTTP GET with Query String Run it with:

  • Golang: Byte and Bytes

    References: How to Create a Byte Array in Golang (askgolang.com) GoLang Byte Array to String – GoLang Docs GoLang bytes – variable and package – GoLang Docs

  • Golang: New Keyword

    In Golang there are several ways to create instance of struct. Say we have this Person struct: We can instantiate this struct with: When using the new keyword you will get reference of the struct in return. References:

  • Golang: HTTP Server

    To test, you can run: It should response one of the three methods (or all three). UPDATE: Before Golang version 1.22, you only can define “path” as the first argument of http.HandleFunc. But, starting from Golang version 1.22 the pattern becomes: Please check here for more information about the new pattern https://pkg.go.dev/net/http#hdr-Patterns. References:

  • Golang: Printing Struct

    Say we have a struct like this: Then in your main function you have: Printing the struct using print function: Printing the struct using json.MarshalIndent function: References:

  • VueJS: Setup with Vite and Vue Router

    Installation Add Vue Router Load Vue Router Go to src/main.ts If you are using example from Getting Started | Vue Router (vuejs.org), then you have to make changes from: To: Otherwise, the app will not load and there is this error in the browser console. Another fix is by changing the code from: To: Or:…

  • RabbitMQ: Basic

    Producer (Publisher) Service that wants to send messages. Message Persistence is a property of messages. To mark a message as persistent, set its delivery mode to 2. AMQP brokers handles persistent messages by writing them to disk inside a special persistency log file, allowing them to be restored in the event of server restart. Notice…

  • QuasarJS: Setup Testing with Vitest

    #1. Install Quasar. Choose Vite as the development server. #2. Install Vitest using Quasar Application Extension (AE). #3. Choose Vitest. #4. Select necessary options: #5. Run Vitest (The AE provides test examples that you can run with). Or, if you choose to add the Extra “scripts” you can use bellow command. References: