Skip to content

Instantly share code, notes, and snippets.

View CodeNinjaUG's full-sized avatar
🏠
Active

Segayi Andrew CodeNinjaUG

🏠
Active
View GitHub Profile
@CodeNinjaUG
CodeNinjaUG / .txt
Created January 22, 2024 14:09
Setting the Mysql For Hostinger VPS
```It seems like there are issues with the InnoDB storage engine and the inability to lock the `ibdata1` file. This can be a common problem when the MySQL server is not shut down properly, or there are permission issues.
Here are some steps you can take to resolve this issue:
1. **Stop MySQL Service:**
```
sudo service mysql stop
```
2. **Backup Existing Data:**
{
"countries": [
{
"name": "Afghanistan",
"code": "AF"
},
{
"name": "Åland Islands",
"code": "AX"
},
package api
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"reflect"
@CodeNinjaUG
CodeNinjaUG / gist:d23f9532c9d55d47794354056fd73291
Created March 2, 2023 11:40
testing to see if the method returns an interface
func (order Order) StoreTransactions() interface{} {
config, _ := config.LoadConfig(".")
var payment Payment
query := `INSERT INTO payments(amount, reference,payment_method,created_at)
VALUES(@paymentAmount, @paymentReference, @paymentMethod, @paymentCreatedAt) return(id)`
trans := pgx.NamedArgs{
"paymentAmount": order.Total,
"paymentReference": Random(20),
"paymentMethod": "Cash",
"paymentCreatedAt" : time.Now(),