So I was working with pulsar and come across this error while coding with

PulsarClient.builder()

Calls to static methods in Java interfaces are prohibited in JVM target 1.6. Recompile with ‘-jvm-target 1.8’

open your build.gradle.kts and append the following

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}

that should…


so you want to use the logger from go.uber.org/zap globally, and there are several ways of doing it: (for shortest way jump to #4)

1. pass-it-down

(just too many to pass it down and you know how)

2. Injection

func main() {
logger, _ := zap.NewProduction()
otherPackage1.Logger = logger
otherPackage2.Logger = logger
.... // tedious >_<
}
// other package
package otherPackage1
var Logger *zap.Logger
...
func main() {
// Logger.Info(...)
}

3. Own package

package zapLogger
import (
"go.uber.org/zap"
)
var logger *zap.Logger
func Init() {
l, _ = zap.NewProduction()
logger = l
}
// other package
import ...
// you'll have to use zapLogger.logger.Info(...) …


There are a lot of tools out there that do the full-fledged mock (for testing github.com/slack-go/slack), but I still decide to provide an alternative because

  1. Instead of mocking slack client, I mock HTTP
  2. I only need a (very) few test cases, and I want something very lightweight.

So the steps are:

  1. mock the server
  2. create a service that will consume the api-client ( slack-go )
  3. write test

1. Mock The Server

I’m going to use PostMessage as an example/guide for you to follow. The PostMessage will use /chat.postMessage endpoint. (feel free to lock up Slack’s doc or discover it from your error output)

Let’s define a serve mux…


While I was reading/watching various resources (basecamp) about working remotely, and being a remote software engineer for years, here are some of the tips:

  1. Video meetings: only require people who need to be in the meeting, as few as possible
  2. Video meetings are only used for debating/discussion when typing cannot resolve or conclude
  3. Trust people even if you don’t see them, and they will trust you back. Trust is a feeling and this should be set at the hiring process
  4. Managers should be able to evaluate the quality of the works being done in the team and by each individual…

so there’s a latency problem between your mac and your bluetooth headphone, and almost all of the methods requires “bluetooth explorer” tool and you’ll have to download it.

TL;DR;

Forget…


Install Brew (skip if you already did)

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Update & Install Go

brew update&& brew install golang

Setup Workspace

It’s considered best practice to use $HOME/go location for your workspace, so let’s do that!

mkdir -p $HOME/go/{bin,src,pkg}

We created two important folders bin and src that’ll be used for GO

Setup Environment

We’ll need to add to .bashrc or .zshrc (if you’re using zsh) with the following info. (Ex: nano ~/.bashrc )

export GOPATH=$HOME/go
export GOROOT="$(brew --prefix golang)/libexec"
export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin"

reload the settings with source $HOME/.bashrc (or .zshrc )

Feel free to start any project (make new folder) under ~/go/src and go from there.

Extra: Go Version Manager (GVM)

If you wish To run multiple version…


So you’ve followed along the docs to install MSSQL server 2019 on ubuntu 18.04 and you’ve encountered the following error:

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2746.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Client unable to establish connection.

well, let’s get that fixed right away!

Reason Why it’s Not Working

TL;DR; SQL Server 2017/2019 have a dependency on OpenSSL v1.0, while Ubuntu 18.04 comes with v1.1

Step 1 — Stop SQL Server

sudo systemctl stop mssql-server

Step 2 — Configuration

sudo systemctl edit mssql-server

then add the following line

[Service]
Environment="LD_LIBRARY_PATH=/opt/mssql/lib"

save and exit

Step 3 — Link OpenSSL

sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /opt/mssql/lib/libssl.sosudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0…


This guide will import ONLY posts and feature image. Current migration only supports ghost v1, so if you don’t care about users and other stuff, read on!

Main Steps

  1. Export wp_posts and wp_postmeta from word-press
  2. Have ghost db created and restore above 2 table over
  3. Run a(my) node script

Step 1: Export those tables

the only two tables that we need are wp_posts and wp_postmeta tables.
postmeta will contain feature image information that we need to each post. Feel free to use any backup tools or PHPMyAdmin for exporting these two tables from your WordPress site

Step 2: Import those tables

After running ghost install you should find ghost’s DB created in…

Jim Kang

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store