All of the following information is based on go version go1.17.1 darwin/amd64
.
GOOS | Out of the Box |
---|---|
aix |
✅ |
android |
✅ |
package main | |
import ( | |
"encoding/json" | |
"os" | |
"reflect" | |
"text/template" | |
) |
package main | |
// Simple, single-threaded server using system calls instead of the net library. | |
// | |
// Omitted features from the go net package: | |
// | |
// - TLS | |
// - Most error checking | |
// - Only supports bodies that close, no persistent or chunked connections | |
// - Redirects |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
package main | |
import ( | |
"net/http" | |
"github.com/prometheus/client_golang/prometheus" | |
) | |
var ( | |
cpuTemp = prometheus.NewGauge(prometheus.GaugeOpts{ |
This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.
Convert .mov/.MP4 to .gif
As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.
This is not limited to developer, anyone has this need can use this method to convert the files.
# import config. | |
# You can change the default config with `make cnf="config_special.env" build` | |
cnf ?= config.env | |
include $(cnf) | |
export $(shell sed 's/=.*//' $(cnf)) | |
# import deploy config | |
# You can change the default deploy config with `make cnf="deploy_special.env" release` | |
dpl ?= deploy.env | |
include $(dpl) |
<?php | |
/** | |
* Class Container | |
*/ | |
class Container | |
{ | |
/** | |
* @var array | |
*/ |
Picking the right architecture = Picking the right battles + Managing trade-offs
package log | |
import ( | |
"fmt" | |
"github.com/Sirupsen/logrus" | |
"runtime" | |
"strings" | |
) | |
var logger = logrus.New() |