AMP: Accelerated Mobile Pages

The AMP Project is an open-source initiative aiming to make the web better for all. The project enables the creation of websites and ads that are consistently fast, beautiful and high-performing across devices and distribution platforms.

AMP pages are built with 3 core components:

AMP HTML ⚡

AMP HTML is a way to build web pages that render with reliable and fast performance. It is our attempt at fixing what many perceive as painfully slow page load times – especially when reading content on the mobile web. AMP HTML is built on existing web technologies; an AMP page will load (quickly) in any modern browser.

You can learn more at ampproject.org including what AMP is, how it works and the importance of validation in AMP. You can also walk through creating an AMP page and read through the reference docs.

Golang Tutorial: What's DefaultServeMux in net/http

craete a HTTPS Server use net/http and route handle function by DefaultServeMux, see code below:

package main

import (
	"net/http"
	"fmt"
	"log"
)

func hello(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "[%s]: hello!", r.Host)
}

func world(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "[%s]: world!", r.Host)
}

func main() {
	server := http.Server{
		Addr: "127.0.0.1:8080",
	}
	http.HandleFunc("/hello", hello)
	http.HandleFunc("/world", world)

	log.Fatal(server.ListenAndServe())
}

Golang Tutorial: Create HTTPS Server use net/http

It is simple to craete a HTTPS Server use net/http, see code below:

package main

import (
	"net/http"
	"fmt"
)

type SimpleHandler struct {
	Name string
}

func (h *SimpleHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "%s: Hello World!", h.Name)
}

func main() {
	server := http.Server{
		Addr:    "127.0.0.1:8080",
		Handler: &SimpleHandler{Name: "SimpleServer"},
	}
	server.ListenAndServeTLS("cert.pem", "key.pem")
}

陶渊明 -「桃花源记」

        晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷,渔人甚异之。复前行,欲穷其林。

  林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田美池桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。

  见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”

  既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。

  南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终,后遂无问津者。

老子 - 「道 德 經」

第 一 章

道 可 道 , 非 常 道 。 名 可 名 , 非 常 名 。  
无 名 天 地 之 始 ﹔ 有 名 万 物 之 母 。  
故 常 无 , 欲 以 观 其 妙 ﹔ 常 有 , 欲 以 观 其 徼 。  
此 两 者 , 同 出 而 异 名 , 同 谓 之 玄 。  
玄 之 又 玄 , 众 妙 之 门 。  

第 二 章

天 下 皆 知 美 之 为 美 , 斯 恶 已 。  
皆 知 善 之 为 善 , 斯 不 善 已 。  
有 无 相 生 , 难 易 相 成 , 长 短 相 形 ,  
高 下 相 盈 , 音 声 相 和 , 前 后 相 随 。  
恒 也 。 是 以 圣 人 处 无 为 之 事 ,  
行 不 言 之 教 ﹔ 万 物 作 而 弗 始 ,  
生 而 弗 有 , 为 而 弗 恃 , 功 成 而 不 居 。   
夫 唯 弗 居 , 是 以 不 去 。