Skip to content

Instantly share code, notes, and snippets.

@vuon9
vuon9 / .gitconfig
Last active March 22, 2020 15:57
Git configuration for multiple identities
; put this content into ~/.gitconfig
[core]
editor = 'code' --wait
[url "ssh://redirect-to-somewhere"]
insteadOf = https://scm-git-private.server.com/
[alias]
; https://dev.to/nishina555/how-to-ignore-files-already-managed-with-git-locally-19oo
@vuon9
vuon9 / sqlboiler_example_mock.go
Last active December 12, 2023 09:27
Unit testing with SQLBoiler
package services
import (
"database/sql"
"reflect"
"regexp"
"testing"
"github.com/DATA-DOG/go-sqlmock"
"github.com/volatiletech/sqlboiler/boil"
)
@vuon9
vuon9 / windows-10-all-things.md
Last active November 23, 2022 06:34
Windows 10 all things

Windows 10 all things

To make it works like a charm, or just works nearly-like a Mac environment, or just an adaptive for a PC 10 years old, instead disable too much features as tweak registry keys, or some tips like Windows 7 optimization.

Tuning tips

// create a bookmark and use below code (w/o comments) as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
@vuon9
vuon9 / gist:8c0d9814d4329a039d051cda09bb71ff
Last active January 12, 2020 14:18
Xiaomi A2 troubleshooting after upgrade Android 10
@vuon9
vuon9 / windows-terminal-personal-configuration.json
Last active February 16, 2020 06:41
Windows Terminal configs
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"profiles": {
@vuon9
vuon9 / jsconfig.json
Last active March 8, 2020 16:07
VSCode mapping import path to component
{
"compilerOptions": {
"jsx": "react",
"target": "ES6",
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"paths": {
"@app/*": ["app/*"],
"@internals/*": ["internals/*"]
}
@vuon9
vuon9 / main.go
Created March 29, 2020 17:52 — forked from cespare/main.go
Example of testing Go HTTP servers using httptest.Server.
package main
import (
"log"
"myserver"
"net/http"
)
const addr = "localhost:12345"
@vuon9
vuon9 / .golangci.yml
Last active June 5, 2020 07:51
golangci-lint sample yml configuration
linters:
disable-all: true
enable:
- deadcode
- dupl
- errcheck
- gocritic
- gocognit
- gosimple
- govet
@vuon9
vuon9 / main.go
Last active November 25, 2020 18:09
Try to censore content in JSON properties by Regex
package main
import (
"encoding/json"
"fmt"
"time"
"github.com/dlclark/regexp2"
"github.com/gin-gonic/gin"
)