Skip to content

Instantly share code, notes, and snippets.

suntong

Block or report user

Report or block suntong

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@suntong
suntong / http.go
Created Jun 7, 2019 — forked from AngerM/http.go
High Performance Golang HTTP Client
View http.go
package utils
import (
"context"
"io"
"io/ioutil"
"net"
"net/http"
"strings"
"time"
View foo.go
////////////////////////////////////////////////////////////////////////////
// Program: dbab-svr
// Purpose: Pixel Server in Go
// Authors: Tong Sun (c) 2019, All rights reserved
////////////////////////////////////////////////////////////////////////////
package main
import (
"bufio"
@suntong
suntong / 00index.md
Created Jun 7, 2019
Simple web server implemented in Perl and Go
View 00index.md

Simple web server implemented in Perl and Go

Raw data for blog post

View Dockerfile
# golang:latest as build-env
FROM golang:latest AS build-env
RUN mkdir /app
ADD . /app/
WORKDIR /app
RUN cd /app && GO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o myapp .
# go build -o myapp
FROM alpine
View city month temperature.json
[
{"temperature":4.66,"city":"Eureka","state":"California","month":"1964-1"},
{"temperature":4.7,"city":"Eureka","state":"California","month":"1964-2"},
{"temperature":4.57,"city":"Eureka","state":"California","month":"1964-3"},
{"temperature":4.71,"city":"Eureka","state":"California","month":"1964-4"},
{"temperature":5.04,"city":"Eureka","state":"California","month":"1964-5"},
{"temperature":5.48,"city":"Eureka","state":"California","month":"1964-6"},
{"temperature":5.66,"city":"Eureka","state":"California","month":"1964-7"},
{"temperature":5.7,"city":"Eureka","state":"California","month":"1964-8"},
{"temperature":5.52,"city":"Eureka","state":"California","month":"1964-9"},
View city month temperature.json
[
{"temperature":5.49,"city":"Eureka","state":"California","month":"1964-0"},
{"temperature":5.89,"city":"Eureka","state":"California","month":"1965-8"},
{"temperature":5.55,"city":"Eureka","state":"California","month":"1966-6"},
{"temperature":4.62,"city":"Eureka","state":"California","month":"1967-4"},
{"temperature":5.32,"city":"Eureka","state":"California","month":"1968-2"},
{"temperature":4.65,"city":"Eureka","state":"California","month":"1968-2"},
{"temperature":5.52,"city":"Eureka","state":"California","month":"1969-0"},
{"temperature":5.53,"city":"Eureka","state":"California","month":"1970-8"},
{"temperature":5.43,"city":"Eureka","state":"California","month":"1971-6"},
View gbp push easygen for update.txt
$ gbp push --verbose
gbp:debug: ['git', 'rev-parse', '--show-cdup']
gbp:debug: ['git', 'rev-parse', '--is-bare-repository']
gbp:debug: ['git', 'rev-parse', '--git-dir']
gbp:debug: ['git', 'symbolic-ref', 'HEAD']
gbp:debug: ['git', 'show-ref', 'refs/heads/master']
gbp:debug: ['git', 'config', 'branch.master.remote']
gbp:debug: ['git', 'config', 'branch.master.merge']
gbp:debug: ['git', 'tag', '-l', 'debian/4.0.0-1']
gbp:debug: ['git', 'tag', '-l', 'upstream/4.0.0']
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
You can’t perform that action at this time.