Skip to content

Instantly share code, notes, and snippets.

View shihanng's full-sized avatar

Shi Han shihanng

View GitHub Profile
@shihanng
shihanng / function.tmpl
Last active October 20, 2019 01:24
GoTests
{{define "function"}}
{{- $f := .}}
func {{.TestName}}(t *testing.T) {
{{- with .Receiver}}
{{- if .IsStruct}}
{{- if .Fields}}
type fields struct {
{{- range .Fields}}
{{Field .}} {{.Type}}
@shihanng
shihanng / cVimrc
Last active September 5, 2019 05:19
cVimrc
set autoupdategist
set typelinkhints
let searchlimit = 30
let scrollstep = 70
let barposition = "bottom"

Keybase proof

I hereby claim:

  • I am shihanng on github.
  • I am shihanng (https://keybase.io/shihanng) on keybase.
  • I have a public key ASCxoZQPsLAc5oZF20Qagmsb6zPTM1HBBckyazPsvGWGMwo

To claim this, I am signing this object:

@shihanng
shihanng / service_svc.go.patch
Last active June 16, 2018 14:17
c3c4ab8bfbb5/svc/servicea/cmd/servicea_svc/service_svc.go.patch
diff --git svc/servicea/cmd/servicea_svc/servicea_svc.go svc/servicea/cmd/servicea_svc/servicea_svc.go
index 57f2486..8d2e583 100644
--- svc/servicea/cmd/servicea_svc/servicea_svc.go
+++ svc/servicea/cmd/servicea_svc/servicea_svc.go
@@ -1,31 +1,20 @@
-package main
+package servicea_svc
import (
"context"
@shihanng
shihanng / main.go
Created June 16, 2018 11:52
c3c4ab8bfbb5/servicea/main.go
package main
import (
"google.golang.org/appengine"
_ "github.com/shihanng/gaegoasample/svc/servicea/cmd/servicea_svc"
)
func main() {
appengine.Main()
@shihanng
shihanng / app.yaml
Created June 16, 2018 11:41
c3c4ab8bfbb5/servicea/app.yaml
runtime: go
api_version: go1.9
service: default
handlers:
- url: /.*
script: _go_app
@shihanng
shihanng / api.go.patch
Created June 15, 2018 00:01
c3c4ab8bfbb5/svc/servicea/api.go.patch
diff --git svc/servicea/api.go svc/servicea/api.go
index 99370e4..a974b63 100644
--- svc/servicea/api.go
+++ svc/servicea/api.go
@@ -5,6 +5,7 @@ import (
"log"
api "github.com/shihanng/gaegoasample/svc/servicea/gen/api"
+ "google.golang.org/appengine"
)
@shihanng
shihanng / design.go
Created June 14, 2018 23:50
c3c4ab8bfbb5/svc/servicea/design/design.go
package design
import . "goa.design/goa/http/design"
import . "goa.design/goa/http/dsl"
import _ "goa.design/goa/codegen/generator"
var _ = API("servicea", func() {
Title("The service a")
})
@shihanng
shihanng / README.md
Last active May 3, 2018 01:15
Auto-mount CIFS on Solus (or any other Linux OS)

Append something like below into /etc/fstab

# /etc/fstab: static file system information.
#
# <fs>      <mountpoint> <type> <opts>      <dump/pass>
...
//192.168.0.10/path/to/source /path/to/target cifs user,uid=1000,_netdev,noauto,x-systemd.automount,credentials=/path/to/cred 0 0
  • The value for uid can be obtained via
@shihanng
shihanng / .chunkwmrc
Last active January 6, 2024 04:17
chunkwm + skhd
#!/bin/bash
#
# NOTE: specify the absolutepath to the directory to use when
# loading a plugin. '~' expansion is supported.
#
chunkc core::plugin_dir /usr/local/opt/chunkwm/share/chunkwm/plugins
#