Skip to content

Instantly share code, notes, and snippets.

@BoRuDar
BoRuDar / configure-https-git-links.sh
Last active July 28, 2021 11:21 — forked from taoyuan/npm-using-https-for-git.sh
Force git to use git:// instead of https://
@BoRuDar
BoRuDar / get latest tag
Created August 10, 2020 13:12
GIT tips
git describe --tags $(git rev-list --tags --max-count=1)
@BoRuDar
BoRuDar / get go present tool
Last active July 7, 2019 18:39
go present
go get golang.org/x/tools/cmd/present
@BoRuDar
BoRuDar / gocql manual paging
Last active July 27, 2018 08:38
From gocql source
func TestManualQueryPaging(t *testing.T) {
const rowsToInsert = 5
session := createSession(t)
defer session.Close()
if err := createTable(session, "CREATE TABLE testManualPaging (id int, count int, PRIMARY KEY (id))"); err != nil {
t.Fatal(err)
}
COPY mytable FROM 'mybackup' WITH CHUNKSIZE = 1;
@BoRuDar
BoRuDar / Cassandra UDT for Gocassa
Last active April 5, 2020 13:56
Custom marshaling for Cassandra UDT in gocassa
type Target struct {
ID gocql.UUID `json:"id"`
Type string `json:"type"`
}
func (t Target) MarshalUDT(name string, info gocql.TypeInfo) ([]byte, error) {
switch name {
case "id":
return gocql.Marshal(info, t.ID)
case "type":
@BoRuDar
BoRuDar / reflection.go
Created April 2, 2018 18:46
Golang reflection example
package main
import (
"fmt"
"reflect"
"strconv"
)
type name struct {
A string
git config --global url.ssh://git@github.com/.insteadOf https://github.com/