Skip to content

Instantly share code, notes, and snippets.

Field Value
Latitude 36.79887
Longitude 12.01467
Time 18/01/2023 12:21
WITH gis(point) AS (VALUES('POINT(12.01 36.79)'))
SELECT * FROM hotspot
WHERE ST_Distance(location, GeogFromText(gis.point)) < 2000;
CREATE TABLE hotspot (
id UUID PRIMARY KEY,
location GEOGRAPHY NOT NULL,
created_at TIMESTAMP NOT NULL
);
use piston_window::*;
fn main() {
// Create a new Piston window
let mut window: PistonWindow = WindowSettings::new("Pong Game", [640, 480])
.exit_on_esc(true)
.build()
.unwrap();
// Set up the game objects (paddles and ball)
// "Pong Game", by ChatGPT
use piston_window::*;
fn main() {
// Create a new Piston window
let mut window: PistonWindow = WindowSettings::new("Pong Game", [640, 480])
.exit_on_esc(true)
.build()
.unwrap();
package main
import (
"flag"
"fmt"
"os"
"os/exec"
"strings"
"time"
)
func main() {
targetPtr := flag.String("target", ".", "path to the Go program")
revisionPtr := flag.String("revision", "", "a version number for the executable. If not explicitly set, gozip uses the current datetime")
flag.Parse()
fmt.Println("target", *targetPtr)
fmt.Println("revision", *revisionPtr)
}
Command Name Description
command Enters in SDK mode
takeoff Auto takeoff
land Auto landing
up x Ascend to "x" cm
down x Descend to "x" cm
right x Fly right for “x” cm
left x Fly left for “x” cm
void setup() {
Wire.begin(27, 26);
Serial.begin(115200);
Serial1.begin(1000000, SERIAL_8N1, 23, 18);
Wire.setClock(400000);
// Initializes the LED matrix to show a moving text. It will be disabled later by `matrix_effect_deinit`
tt_matrix.Init(255);
void move_sprite() {
while(1) {
tt_matrix.SetAllPWM((uint8_t *)sprite_a);
delay(500);
tt_matrix.SetAllPWM((uint8_t *)sprite_b);
delay(500);
}
}