title |
---|
Managing & Developing Extensions |
omni
is a Postgres shared library (and also an extension) that helps managing and developing Postgres easier. Think of it like an extension for extensions !
import requests | |
import json | |
import time | |
import base64 | |
import os | |
from pydantic import BaseModel, Field | |
from datetime import datetime | |
class ExtractSchema(BaseModel): | |
company_name: str |
#include "postgres.h" | |
#include "fmgr.h" | |
#include "executor/spi.h" | |
#include "inttypes.h" | |
PG_MODULE_MAGIC; | |
PG_FUNCTION_INFO_V1(add_nums); |
. | |
├── go.mod | |
├── handlers | |
│ ├── books | |
│ │ └── books.go | |
│ └── env.go | |
├── main.go | |
└── models | |
└── models.go |
package main | |
import ( | |
"log" | |
"context" | |
"fmt" | |
"github.com/docker/docker/client" | |
natting "github.com/docker/go-connections/nat" | |
"github.com/docker/docker/api/types/container" |
package main | |
import "fmt" | |
type DB struct { | |
Name string | |
} | |
// double pointer | |
// a pointer which points to another pointer |
// There are two ways I can convert json body to struct. Don't know what's the difference. | |
// https://www.reddit.com/r/golang/comments/5yhfo1/jsondecoder_vs_jsonunmarshal/ | |
// Other than reddit reference I don't see any other links. | |
//Method1: | |
var c Service | |
byteArray, err := ioutil.ReadAll(req.Body) | |
if err != nil { | |
log.Fatalf("fatal: reading from readall body %v", req.Body) | |
} |
#!/bin/bash | |
# stop the container | |
echo "stopping mydemoapp docker container..." | |
sudo docker stop mydemoapp | |
# remove the container | |
echo "removing mydemoapp docker container..." | |
sudo docker rm mydemoapp |
1. never deploy django project with debug=true | |
https://docs.djangoproject.com/en/3.2/ref/settings/#debug |
addEventListener("fetch", event => { | |
return event.respondWith(handleRequest()) | |
}) | |
async function handleRequest() { | |
const init = { | |
"headers": { | |
"x-rapidapi-key": "<replaceme>", | |
"x-rapidapi-host": "community-open-weather-map.p.rapidapi.com" | |
}, |