This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[17:00:07] visi:stolon git:(lawrence-checkpoint-before-rewind*) $ cat patch.txt | |
diff --git a/cmd/keeper/cmd/keeper.go b/cmd/keeper/cmd/keeper.go | |
index 047a2e7..919a5b4 100644 | |
--- a/cmd/keeper/cmd/keeper.go | |
+++ b/cmd/keeper/cmd/keeper.go | |
@@ -849,10 +849,11 @@ func (p *PostgresKeeper) resync(db, masterDB, followedDB *cluster.DB, tryPgrewin | |
// rewind that it targets the current primary, rather than whatever database we | |
// follow. | |
connParams := p.getSUConnParams(db, masterDB) | |
+ sslmode := masterDB.Spec.PGParameters["ssl"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/bitfield/script" | |
"strings" | |
) | |
func main() { | |
fmt.Println("Hello World") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. never deploy django project with debug=true | |
https://docs.djangoproject.com/en/3.2/ref/settings/#debug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type DB struct { | |
Name string | |
} | |
// double pointer | |
// a pointer which points to another pointer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
βββ go.mod | |
βββ handlers | |
β βββ books | |
β β βββ books.go | |
β βββ env.go | |
βββ main.go | |
βββ models | |
βββ models.go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "postgres.h" | |
#include "fmgr.h" | |
#include "executor/spi.h" | |
#include "inttypes.h" | |
PG_MODULE_MAGIC; | |
PG_FUNCTION_INFO_V1(add_nums); |