Skip to content

Instantly share code, notes, and snippets.

@danmux
danmux / remove.go
Last active March 15, 2022 19:26
remove front or back
// remove will remove drop from the start or end of s.
// If drop is not found at front or end of s then the
// original string is returned. If drop occurs at the
// start and end of s, it will only be dropped from the
// start.
func remove2(s, drop string) string {
if strings.HasPrefix(s, drop) {
return strings.TrimPrefix(s, drop)
}
return strings.TrimSuffix(s, drop)
@danmux
danmux / cmd.sh
Created March 2, 2019 17:12
git pager stays on screen
git config --global --replace-all core.pager "less -F -X"
@danmux
danmux / .zshrc.sh
Last active March 2, 2019 17:14
oh my zsh rc script golang and git
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@danmux
danmux / robbyrussell-light.zsh-theme
Created February 27, 2019 11:34
oh my zsh robbyrussell light theme
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT='${ret_status} %{$fg[black]%}%c%{$reset_color%} $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[red]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"

Keybase proof

I hereby claim:

  • I am danmux on github.
  • I am danmux (https://keybase.io/danmux) on keybase.
  • I have a public key ASAe8Fp7aPFSOA7EUbWXDpzLPCcp6sm2XE295-pvrwCAUgo

To claim this, I am signing this object:

package iban
import (
"testing"
"libs/hbci/iban/assert"
)
func TestParseIbanAsser(t *testing.T) {
// Valid IBAN
package iban
import "testing"
func ibanParseEqual(t *testing.T, iban, cc, cd, bb string, willErr bool) {
got, err := Parse(iban)
if willErr && err == nil {
t.Error("expected error")
}
if !willErr && err != nil {
package iban
import "testing"
func eq(t *testing.T, got, want, note string) {
if got != want {
t.Errorf("%s got <%s> wanted <%s>", note, got, want)
}
}
package iban
import "testing"
import "reflect"
func TestParseDE(t *testing.T) {
fix := []struct {
in string
iban Iban
err bool
package iban
import "testing"
func TestParse(t *testing.T) {
// Valid IBAN
iban, err := Parse("DE10123")
if err != nil {
t.Error(err.Error())
}