Skip to content

Instantly share code, notes, and snippets.

View t2krew's full-sized avatar
😄
hello world~

Krew t2krew

😄
hello world~
  • ShenZhen, China
View GitHub Profile
@t2krew
t2krew / dateCN.js
Created January 14, 2021 10:06 — forked from lvwzhen/dateCN.js
获取当前公历、农历、节气
// JavaScript Document
function RunGLNL() {
var today = new Date();
var d = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
var DDDD = today.getFullYear() + "年" + [today.getMonth() + 1] + "月" + today.getDate() + "日";
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
if (intHours == 0) {
hours = "12:";
@t2krew
t2krew / custom_json.go
Created September 30, 2019 02:16 — forked from mdwhatcott/custom_json.go
Example of implementing MarshalJSON and UnmarshalJSON to serialize and deserialize custom types to JSON in Go. Playground: http://play.golang.org/p/7nk5ZEbVLw
package main
import (
"bytes"
"encoding/json"
"fmt"
"strconv"
)
func main() {
@t2krew
t2krew / go-os-arch.md
Created September 9, 2019 06:16 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.8.3 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • android
  • darwin
@t2krew
t2krew / sysctl.conf
Created October 7, 2016 02:58 — forked from kfox/sysctl.conf
Linux kernel tuning settings for large number of concurrent clients
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0