Skip to content

Instantly share code, notes, and snippets.

View rdumont's full-sized avatar

Rodrigo Dumont rdumont

View GitHub Profile
@rdumont
rdumont / README.md
Last active June 14, 2021 09:03
Go test coverage in VS Code

Requirements

  • Coverage Gutters: vscode extension to display language-agnostic coverage from lcov reports
  • Reflex: to watch files and perform actions on change
  • gcov2lcov: to convert from Go's coverage report format to lcov
  • gotest: optional, you could just use go test

Usage

The path to what you want to test is required.

@rdumont
rdumont / package.json
Last active June 10, 2020 19:53
test script
{
"name": "say-hi",
"version": "0.1.1",
"dependencies": {
"semver": "^7.3.2"
},
"bin": "./say-hi.js"
}
@rdumont
rdumont / gin.go
Created July 22, 2019 20:04
Profile Go micro-services in Kubernetes with pprof
func main() {
r := gin.New()
r.GET("/", serveHTTP)
r.Any("/debug/*path", gin.WrapH(http.DefaultServeMux))
http.ListenAndServe(":8080", r)
}
@rdumont
rdumont / gorilla_mux.go
Created July 22, 2019 20:03
Profile Go micro-services in Kubernetes with pprof
func main() {
r := mux.NewRouter()
r.HandleFunc("/", serveHTTP)
r.Handle("/debug/", http.DefaultServeMux)
http.ListenAndServe(":8080", r)
}
@rdumont
rdumont / http_serve_mux.go
Created July 22, 2019 20:03
Profile Go micro-services in Kubernetes with pprof
func main() {
r := http.NewServeMux()
r.HandleFunc("/", serveHTTP)
r.Handle("/debug/", http.DefaultServeMux)
http.ListenAndServe(":8080", r)
}
@rdumont
rdumont / main.go
Created July 22, 2019 20:01
Profile Go micro-services in Kubernetes with pprof
package main
import (
"net/http"
_ "net/http/pprof"
)
func main() {
http.HandleFunc("/", serveHTTP)
http.ListenAndServe(":8080", nil)

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am rdumont on github.
  • I am rdumont (https://keybase.io/rdumont) on keybase.
  • I have a public key whose fingerprint is 741D 8C00 71EE 12FD BF2B 8715 D147 E51A 8A60 1539

To claim this, I am signing this object:

@rdumont
rdumont / Index.cshtml
Created November 15, 2011 16:16
Using SquishIt pre-1.8.1 with ASP.NET MVC
@using MvcApplication1.Extensions
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
@Html.BundleCss().Add(
"~/Content/Site.css"
).MvcRender("~/Content/styles_#.css")
@rdumont
rdumont / SettingsValueEqualityComparer.cs
Created October 29, 2014 03:29
Comparing Two Objects: How Hard Can It Be?
using System;
using System.Collections.Generic;
public class SettingsValueEqualityComparer : IEqualityComparer<object>
{
public new bool Equals(object a, object b)
{
// If the equality operator considers them to be equal, great!
// Both being null should fall in this case.
if (a == b)