Skip to content

Instantly share code, notes, and snippets.

View henvic's full-sized avatar

Henrique Vicente henvic

View GitHub Profile
@henvic
henvic / .vimrc
Created May 8, 2020 14:19
.vimrc
set backspace=indent,eol,start
nnoremap <BS> X
if version >= 703
set undofile
set undodir=$HOME/.vim/undo
set undolevels=1000
set undoreload=10000
endif
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>trustList</key>
<dict>
<key>027268293E5F5D17AAA4B3C3E6361E1F92575EAA</key>
<dict>
<key>issuerName</key>
<data>
@henvic
henvic / cl-test.log
Last active April 15, 2020 08:29
TestSystemRoots results in
$ GO111MODULE=on go get golang.org/dl/gotip@latest
$ gotip download 227037
$ GODEBUG=x509roots=1 gotip test crypto/x509 -v -run TestSystemRoots
=== RUN TestSystemRoots
crypto/x509: trust settings for CN=Blue Coat Public Services Intermediate CA,OU=Symantec Trust Network,O=Blue Coat Systems\, Inc.,C=US: SecTrustSettingsCopyTrustSettings error: -25262
crypto/x509: trust settings for CN=CINRADIUS2.windows.cin.ufpe.br: 4
crypto/x509: trust settings for CN=windows-CINRADIUS2-CA: 1
crypto/x509: trust settings for CN=CINRADIUS2.windows.cin.ufpe.br: 4
crypto/x509: trust settings for CN=Charles Proxy Custom Root Certificate (built on henvic-mp.local\, 19 Oct 2015),OU=http://charlesproxy.com/ssl,O=XK72 Ltd,L=Auckland,ST=Auckland,C=NZ: 1
crypto/x509: trust settings for CN=localhost.localdomain,OU=VMware ESX Server Default Certificate,O=VMware\, Inc,L=Palo Alto,ST=California,C=US: 4
@henvic
henvic / .gitignore
Last active April 5, 2019 16:25
certlistener (old)
mocks/certs/example.org
function publish() {
equinox release \
--version=$NEW_RELEASE_VERSION \
--channel=$RELEASE_CHANNEL \
--config=$config \
-- \
-ldflags="-X 'github.com/wedeploy/cli/defaults.Version=$NEW_RELEASE_VERSION' \
-X 'github.com/wedeploy/cli/defaults.Build=$BUILD_COMMIT' \
-X 'github.com/wedeploy/cli/defaults.BuildTime=$BUILD_TIME'" \
-gcflags=-trimpath=$GOPATH \
@henvic
henvic / README.md
Last active February 21, 2019 21:49
Go repositories licenses on GitHub
@henvic
henvic / README.md
Last active February 21, 2019 21:48
Go repositories licenses on GitHub (February, 2019)
@henvic
henvic / time-afterfunc-vs-sleep.go
Created September 17, 2016 06:51
golang question: time.AfterFunc vs. time.Sleep
// golang question: what code is better?
// Scenario: inside a callback you have to take an action - say, send a response - after some time
// How would you accomplish it? Why?
// What if it is test code?
// What if it is production code?
// Would you write the code like this?
mux.HandleFunc("/url", func(w http.ResponseWriter, r *http.Request) {
var e = make(chan struct{}, 1)
time.AfterFunc(800*time.Millisecond, func() {
@henvic
henvic / main.go
Created October 16, 2017 21:11
Simple dirty example of using Go's json.Marshal and json.Unmarshal
package main
import (
"encoding/json"
"fmt"
"log"
)
// Event to record
type Event struct {
@henvic
henvic / indirect.go
Last active April 4, 2018 09:03
indirect (similar to json.Unmarshal(data []byte, v interface{}) - Public Domain, MIT License
package indirect
import (
"errors"
"fmt"
"reflect"
)
// Inspired by the unmarshal functions on
// https://golang.org/src/encoding/json/decode.go