Configure environment variable
export DATABASE_URL=postgres://postgres@localhost/dbname?sslmode=disable
Run in CLI
go run main.go -page 1
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"net/http/httputil" | |
) |
// Compile like this: g++ fullauto.cpp --std=c++17 -o fullauto | |
// Run like this: sudo fullauto & | |
#include <thread> | |
#include <chrono> | |
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <vector> |
#!/bin/bash | |
## Update Golang (Linux/Mac) | |
go version | |
## Get Last Stable Version | |
LAST_VERSION=$(curl -s 'https://go.dev/VERSION?m=text'|head -n1) | |
os="linux" | |
if [ "$(uname -s)" = "Darwin" ]; then |
import json | |
def json_titles_tuple(payload_json, prefix=''): | |
jsonobj = json.loads(payload_json) | |
titles = () | |
for key, value in jsonobj.items(): | |
if isinstance(value, dict): | |
titles += json_titles_tuple(json.dumps(value), prefix + key + '_') | |
else: | |
titles += (prefix + key,) |
package main | |
import ( | |
"net/http" | |
"github.com/aws/aws-lambda-go/events" | |
"github.com/aws/aws-lambda-go/lambda" | |
) | |
func handler(request events.APIGatewayProxyRequest) (*events.APIGatewayProxyResponse, error) { |
package exemple | |
func MapIntervalFloat64(value, fromLow, fromHigh, toLow, toHigh float64) (ret float64) { | |
ret = (value-fromLow)*(toHigh-toLow)/(fromHigh-fromLow) + toLow | |
return | |
} | |
func SimpleMapIntervalFloat64(value, fromHigh, toHigh float64) (ret float64) { | |
ret = value * toHigh / fromHigh | |
return |
package main | |
import ( | |
"fmt" | |
"net" | |
"net/http" | |
"github.com/gorilla/mux" | |
) |
package main | |
import ( | |
"context" | |
"log" | |
"github.com/chromedp/chromedp" | |
) | |
func main() { |
package strarray | |
import ( | |
"encoding/json" | |
"errors" | |
) | |
var ( | |
// ErrUnsupportedType is returned if the type is not implemented | |
ErrUnsupportedType = errors.New("unsupported type") |
Configure environment variable
export DATABASE_URL=postgres://postgres@localhost/dbname?sslmode=disable
Run in CLI
go run main.go -page 1