View main.go
package main | |
import ( | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"strconv" | |
"time" | |
geojson "github.com/paulmach/go.geojson" |
View gormjoin.go
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"time" | |
"gorm.io/driver/postgres" | |
"gorm.io/gorm" | |
) |
View gist:4a817c777d2dbd31232b8112d34a0a62
#! /bin/bash | |
cat << EOD | |
Format/result | Command | Output | |
--------------------------------+-------------------------------+------------------------------ | |
YYYY-MM-DD_hh:mm:ss | date +%F_%T | $(date +%F_%T) | |
YYYYMMDD_hhmmss | date +%Y%m%d_%H%M%S | $(date +%Y%m%d_%H%M%S) | |
YYYYMMDD_hhmmss (UTC version) | date --utc +%Y%m%d_%H%M%SZ | $(date --utc +%Y%m%d_%H%M%SZ) | |
YYYYMMDD_hhmmss (with local TZ) | date +%Y%m%d_%H%M%S%Z | $(date +%Y%m%d_%H%M%S%Z) | |
YYYYMMSShhmmss | date +%Y%m%d%H%M%S | $(date +%Y%m%d%H%M%S) |
View goredis_pipeline.go
package main | |
import ( | |
"fmt" | |
"strconv" | |
"github.com/go-redis/redis/v7" | |
) | |
func main() { | |
client := redis.NewClient(&redis.Options{ |
View gjson_foreach_example.go
package main | |
import "github.com/tidwall/gjson" | |
import "fmt" | |
import "strings" | |
func main() { | |
jsonstring := ` | |
{ | |
"status":"ok", |
View libev-client.c
/* | |
* Licensed under the Apache License, Version 2.0. | |
* | |
* simple libev client example | |
* based on multi-process and ring buffer | |
* wangrj1981@gmail.com | |
*/ | |
/* | |
gcc ./libev-client.c -c -o ./libev-client.o -I/usr/local/include/ |
View gist:9803449
/* | |
* No license provided. | |
*/ | |
#define _GNU_SOURCE | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
View gist:9798915
#include <stdio.h> | |
int main() | |
{ | |
printf("hello world\n"); | |
return 0; | |
} |