Author: Website Admin

  • 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:

  • Ubuntu: Soft RAID Install

    #1. Prepare 2 disks for minimum RAID requirement. #2. Boot into Ubuntu installer until you get to this page, choose Custom storage layout: #3. You will see your disks here. #4. Choose the first disk and select Use As Boot Device, do the same for the rest of the disks. #5. For all disks, Select…

  • Nuxt 3: Configure Testing with Vitest

    Installation Setup Create a test file in tests folder Add support for @nuxt/test-utils-edge in vitest.config.ts Run Start the test

  • Ubuntu: Install Nodejs

    Add the repository You can check the full list here https://github.com/nodesource/distributions/tree/master/deb Install Nodejs