Skip to content

Instantly share code, notes, and snippets.

@SerSamgy
SerSamgy / pointer_to_string_representator.go
Created September 11, 2019 14:32
Function that gets pointer to variable of any type and returns string representation of that variable or nil if pointer points to nowhere
package main
import (
"fmt"
"math/cmplx"
"reflect"
)
func GetStringRepresentationOfPointedValue(ptr interface{}) (representation string) {
valueOfPtr := reflect.ValueOf(ptr)
@SerSamgy
SerSamgy / migrate_repo.sh
Created November 22, 2016 14:05 — forked from mariozig/migrate_repo.sh
Migrate repo from GitLab to GitHub Full blog post @ http://ruby.zigzo.com/2015/03/23/moving-from-gitlab-to-github/
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror [email protected]:mario/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.