teleren/devto huggingface dataset:
Hiring employees in foreign country benchmark 
Tags: talent, expansion, compliance
Published: 2019-12-09 15:52:03

Hiring the best talent often goes beyond the inhouse borders and, sad to say, beyond the legal context. In case you or your company strive to breakdown into international markets, some of the key points for hiring global talent outlined below: 
 - Legal fees and government registration fees payout
 - Establishing in-house bank accounts (must be completed in person)
 - Preservation accounting records locally in the market
 - Designating a country manager, paid in the country
 - Breaking down entity/terminate the operations under corporate law
 - Sourcing and managing vendors for booking and HR operations

In addition, companies establishing their presence (hiring) abroad should adhere to a certain ethical context:
 - Freedom of association
 - Right to organize/collective bargaining
 - Restrictions on child labor
 - Restrictions on forced labor
 - Restrictions on discrimination
 - Equal remuneration 

Read the full article at https://www.expressglobalemployment.com/hiring-employees-in-foreign-countries-benchmark/
go install from tools.go on cross-platform
Tags: go, cli
Published: 2019-12-09 15:35:04

---
title: go install from tools.go on cross-platform
published: true
description: Track and use tools.go by go.mod
tags: golang, go, cli
---

# TL;DR

```zsh
go install \
  github.com/sanemat/go-importlist/cmd/import-list \
  github.com/sanemat/go-xgoinstall/cmd/x-go-install
import-list -z tools.go | x-go-install -0
```

Sometimes I want to track and use tool dependencies.

```go
// +build tools

package tools

import (
	_ "github.com/sanemat/go-importlist/cmd/import-list"
	_ "github.com/sanemat/go-xgoinstall/cmd/x-go-install"
	_ "golang.org/x/lint/golint"
	_ "golang.org/x/tools/cmd/goimports"
)

```

[How can I track tool dependencies for a module?](https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module)
[Manage Go tools via Go modules | Marco Franssen](https://marcofranssen.nl/manage-go-tools-via-go-modules/)

Recommended way:
```zsh
$ cat tools.go | grep _ | awk -F'"' '{print $2}' | xargs -tI % go install %
```

But I want to use it on cross-platform, ubuntu, mac, and windows.

```zsh
$ import-list tools.go
github.com/sanemat/go-importlist/cmd/import-list
github.com/sanemat/go-xgoinstall/cmd/x-go-install
golang.org/x/lint/golint
golang.org/x/tools/cmd/goimports
```
Then go install all dependencies.
```zsh
$ import-list tools.go | x-go-install
```

Split by NULL is more secure :wink: 

```zsh
$ import-list -z tools.go | x-go-install -0
```

https://github.com/sanemat/go-importlist
https://github.com/sanemat/go-xgoinstall
🐶 Promises in Recks: Rx+JSX experiment
Tags: rxjs, react, javascript, webdev
Published: 2019-12-09 15:13:15

In the previous episode [we saw](https://dev.to/kosich/recks-rxjs-based-framework-23h5) that streams are native to Recks:

```jsx
function App() {
  const clock$ = timer(0, 1000);

  return <div>{ clock$ }</div>
}
```

<figcaption><a href="https://codesandbox.io/s/recks-example-timer-fjyvj?fontsize=14&hidenavigation=1&theme=dark&module=/src/App" target="_blank">online sandbox</a></figcaption>


Well, the same applies to Promises!

```jsx
function App() {
  const delayed = Promise.resolve('Hello!');
  
  return <div>{ delayed }</div>
}
```

Once the engine receives a promise — it waits for it to resolve and then renders the result in place!

Let's see an example using [axios](https://github.com/axios/axios), requesting its github repo description via [github API](https://developer.github.com/v3/) (yep, we'll use axios to know what axios is 🧐):


```jsx
import axios from 'axios';

function App() {
  const url = 'https://api.github.com/repos/axios/axios';

  return <div>
    <h1>Axios</h1>
    <p>{
      axios.get(url).then(response => response.data.description)
    }</p>
  </div>
}
```
<figcaption><a href="https://codesandbox.io/s/recks-example-promises-w1uvv?fontsize=14&hidenavigation=1&theme=dark&module=/src/App">online sandbox</a></figcaption>

That's it. No need to keep a state in the component or update a store. You just use async values where you need them!

As simple as that 🙂

## To try Recks 🐶

Clone the template repository:

```
git clone --depth=1 https://github.com/recksjs/recks-starter-project.git
cd recks-starter-project
npm i
npm start
```

Or use this [online sandbox](https://codesandbox.io/s/recks-example-greeting-input-tu6tp?fontsize=14&hidenavigation=1&theme=dark)

The source code is available at [github.com/recksjs/recks](https://github.com/recksjs/recks)

## The end

_header photo by [Elena Koycheva](https://unsplash.com/@lenneek?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_
Giving Thanks for Diversity in Tech: Amy Kapernick
Published: 2020-01-07 00:36:30

---
title: Giving Thanks for Diversity in Tech: Amy Kapernick
published: true
date: 2019-12-09 14:57:43 UTC
tags: 
canonical_url: https://www.thisdot.co/giving-thanks-for-diversity-in-tech-amy-kapernick
---

![laracon square](//images.ctfassets.net/zojzzdop0fzx/7huBaGoQlRKAlMDhu6YGEk/b31c1a57a2ac6630a50091904fc8886f/laracon_square.jpg)

Amy Kapernick is a Front End Developer and Developer Evangelist based out of Perth, Western Australia.  She is both a Microsoft MVP, and a Twilio Champion, who shares her knowledge and passion for front end development at conferences all over the world.

Some of Amy’s most recent speaking credits include talks at DDD Brisbane, DDD Adelaide, NDC Olso, NDC London, and Bodies of Information Conference in Perth. Not only an accomplished presenter, however, Amy is also a Co-organiser of Fenders Perth, serves on the Diversity and Inclusion sub-committee for Australian Computer Society WA, and is a committee member for DDD Perth.

Amy’s involvement in inspiring others to learn and achieve within tech is not limited to her work with major conferences and meetups, as she regularly volunteers to give talks at high schools in Australia, where she talks with young girls about what a career in tech can look like, and the different pathways they can take to get there.

When asked about the best advice she could give to women and girls who want to start their careers in tech, Amy said she encourages them to, “find something that they’re passionate about,” adding that, “When they enjoy what they're creating it makes a world of difference.”

If you would like to see Amy speak in the upcoming year, you can catch her at NDC London on January 30th, giving a talk on front-end testing! But if you can’t make it out, you might find Amy out rock climbing, or spending time outdoors with her border collie!

To keep up with what Amy is up to in 2020, you can follow her on Twitter, [@Amys_Kapers](https://twitter.com/Amys_Kapers).
Compile-Time Reflection
Tags: dlang, tutorial, metaprograming, reflection
Published: 2019-12-09 14:52:37

A mirror is a surface which creates a reflection where you can look back at yourself. This is the essence of reflection, code looking back on code. This is where [meta programing] (https://odin.handmade.network/blogs/p/1723-the_metaprogramming_dilemma) lives.

Most languages choose for reflection to happen at runtime, D focuses this during compilation. Let's begin with the basics.

```dlang 
auto foo(T)(T a) {
    import std.conv : to;
    static if(is(typeof(a) == int))
        return a.to!string;
    static if(is(typeof(a) == string)) 
        return a.to!int;
} 

static assert(foo(6) == "6");
static assert(foo("7") == 7);
static assert(foo(foo(8)) == 8);
```

This might be the basics, but this is a rediculous example. I'm wanting to show that one can access the type of a variable `typeof(a)`, but then I throw in [is expressions](https://dlang.org/spec/expression.html#is expression) which is possibly one of the most complicated meta programing tool D has. I've also gone and made my template return two different types based on the argument. On top of all that it isn't even needed in this context `is(T == int)`. 

---

Let me shift gears to how meta programing is more frequently used. 

```dlang 
import std.traits;

T makeLower(T)(T str) if(isSomeString!T) {
    import std.string;
    return str.toLower;
}
makeLower("Hello");
makeLower("Hello"w);
makeLower("Hello"d);
```

If you read some of my other posts you'll know unicode is complicated. D has native types for UTF-8, UTF-16, UTF-32. Templates allow for writing algorithms which work with all (maintaining compile time type safety).

Templates can provide a [constraint](https://dlang.org/spec/template.html#template constraints) which generally examines the type and its behaviors to decide if the template is eligible for the overload set. In this particular case it is looking for types that are D native strings.

---

This is actually what [Ranges](https://dlang.org/phobos/STD_RANGE_PRIMITIVES.HTML) are. Meta programing inspection of types to decide if they meet the required behavior. The only language support for range is to lower foreach loops to call popFront and empty.

Meta programing is a large topic with low level compiler [traits](https://dlang.org/spec/traits.html) and higher level library modules [std.traits](https://dlang.org/phobos/std_traits.html) and [std.meta](https://dlang.org/phobos/std_meta.html). In D it is hard not to take advantage of its reflection when so much of its standard library is filled with its use.
Day 19 of⚡️ #30DaysOfWebPerf ⚡️: Frameworks
Tags: webperf, javascript, performance, webdev
Published: 2019-12-09 14:50:12

{% twitter 1204050214446862336 %}
{% twitter 1204050215189262337 %}

---

This article was originally published on [sia.codes](https://sia.codes/). Head over there if you like this post and want to read others like it, or sign up for my [newsletter](https://buttondown.email/sia.codes) to be notified of new posts!
3 Steps to Make Debugging Easier
Tags: debugging
Published: 2019-12-07 08:11:48

To debug is to problem solve, and problem solving is easier when you have steps to follow. Here are some things I've been thinking more about. I think we all do these things implicitly when debugging, but inspecting how you do something is the first step to improving it.

I'm writing this for myself too, I want to be more conscious about the approach I'm taking when debugging something.

I've found 3 ways to look at a problem while debugging
1. What is the problem I am trying to solve?
2. Does my code do exactly what I thought it did when I wrote it?
3. What tools do I have available and which should I use here?

## Ask "What is the problem I am trying to solve?"

Put the problem into words. As the saying goes, if you can't describe it, you don't understand it. This is as true for the problem, as it is for the solution.

Be as clear as possible, write it down if you have to. Try rephrasing the problem. Try explaining it to someone, or *something* else (rubber ducking).

When you are very sure, and can easily state what you expect, versus what you are getting, you can then move on to the next step.

## Does this code do what I think it does?

Once you understand a problem, you must explain it to the computer. Sometimes what you're saying and what the computer is hearing are different. Sound wacky? I'll explain.

Do this while stepping through the code. Before a line executes, tell yourself "I expect this line to do xyz", then step over it and output or inspect the result.

How well do you know the function you're calling? Did you write it? Does it behave differently depending on certain parameters? 

Read the documentation, read it again. If you don't have the documentation, you'll need to read the code really carefully. It can feel slow, like you're not making progress, but it's time well spent. Add your own comments as you go, document other's code where there is none.

In desperate cases (when you're calling old libraries written by developers long gone), you may even need to write a number of new tests that inspect a method many different ways so you can be sure it will work for the case you are using it 
for.

When the answer is not obvious, you can begin writing small hypotheses. "I if...?", and then go about proving these. 

## What tools do I have available and what should I use here?

Tools are simply ways to break the problem down further, which is why I've left them for last on this list.

Are you logging output? What about the web server logs, have you checked those? 

Sometimes just looking at something like the network requests, or Event Viewer, or a Profiler will cause your brain to think a little more creatively. 

Show the results you're getting to someone else, as them if they expect the same result. Why? Why not?

## Summary

If you have any concepts around debugging please do share them, and of course questions and comments are welcome.
How to make TS more intelligent?
Tags: help, typescript
Published: 2019-12-09 14:40:21

I have a monorepo like this:

```
root/packages
  |-lib1
  |-lib2
  |-lib3
```

`lib3` depends of both `lib1` and `lib2`. I'm using TS v3.7.2 with `composite` (true), `baseUrl`, `paths` and `references` props to be able to work with the new [ts project references](https://www.typescriptlang.org/docs/handbook/project-references.html).

Everything is ok except for one thing: I'm using VSCode, I'm writing something for `lib3` and using an enum from `lib1`, but the enum is still not imported. When I ask VSCode to show me the possible imports for the enum, it doesn't show anything, but if I write the import by hand, it recognize it.

E.g:

#### file in lib3 where VSCode doesn't know where to import from

```ts
export function bla(key: EnumFromLib1) {
  // do something
}
```

#### file in lib3 where VSCode know

```ts
import {} from 'lib1/some/path/to/file';

export function bla(key: EnumFromLib1) {
  // do something
}
```

In the second example, if I press the keyboard shorcut for importing `EnumFromLib1` it will list the possibility from the `lib1/some/path/to/file` file.

So, the question is: How can I configure TS to help him know beforehand that I have more elements in those files?

Thank you!
Seven New Languages to Learn in Seven Weeks
Tags: learning, programming, trends, todayilearned
Published: 2019-12-09 14:33:25

### Introduction

Every year I learn a new language and which ever I feel conformable with I use that as my primary programming language. Unfortunately for last 2 years I have not been able to learn a new language. For my generalist mind this gives me a feel of where and all such languages can best work and also help to appreciate the current language that I use (currently Python). If the new language is really good and compelling and I see a good community and its application in varied applications, then I move to that language (I moved from Ruby to Python). 

### Which Languages to learn

Looking at this [link](https://www.computer.org/publications/tech-news/trends/programming-languages-you-should-learn-in-2020). That seem to give a fair bit of indication what to learn next year. While some may say I am a victim of Hype cycle, but I would rather call it hedging and also someone with a inquisitive self who likes to know what other languages have to offer and why they are popular. Hence I have chosen to learn the following languages in this series.

1. Scala
2. Julia
3. Swift
4. Kotlin
5. Rust
6. Elixr /Erlang
7. Haskell

I have not chosen these languages because all these are trending, but rather because some of them have solved specific problem and in the area I work (Data Analytics) I find some of these languages being used. Hence I wanted to know how good these languages are. 

### Why Seven Weeks
To be honest I just want to learn these languages or  just want to get my feet dirty, rather being an expert. Learning and understanding the tooling gives a lot of help when I am having a conversation with my counterparts or learning when some expert speaks about these languages. Also after this I want to explore some of the open source projects that have used these languages and get a feel of how capable these languages are and if I like I may choose few to master.
### The Format 
I will learn the basics of each language for a week where during weekdays I will have less time and on weekends I will be spending major time learning and possibly creating some tool or program to put into use what I learnt. And then write about it because I forget what I learn and also because I like to share.

### Finally

Not much really, this is one of my more aggressive plans , where I over promise. I hope I deliver this time as lot of things depend on it. But even if I fail, I am sure I will learn a lot of things and I will have lot of good things to share.

*Originally published in [here](https://medium.com/data-ai-ml/seven-new-languages-to-learn-in-seven-weeks-7ac81060e4d9)*
Qvault’s Lead Engineer Interviewed on “Running in Production”
Tags: bitcoin, cryptography, electron, go
Published: 2019-12-09 14:31:13

---
title: Qvault’s Lead Engineer Interviewed on “Running in Production”
published: true
date: 2019-12-09 14:29:56 UTC
tags: Bitcoin,Cryptography,Electron,golang
canonical_url: https://qvault.io/2019/12/09/qvaults-lead-engineer-interviewed-on-running-in-production/?utm_source=rss&utm_medium=rss&utm_campaign=qvaults-lead-engineer-interviewed-on-running-in-production
---

![](https://qvault.io/wp-content/uploads/2019/12/NdK7q7CR-1024x538.jpeg)

Check out the podcast here: [https://runninginproduction.com/podcast/6-qvault-is-an-open-source-tool-to-manage-passwords-and-crypto-keys](https://runninginproduction.com/podcast/6-qvault-is-an-open-source-tool-to-manage-passwords-and-crypto-keys)

First off, thanks to Nick for having me on the show! In this episode of Running in Production, I talk with Nick about about how we built [Qvault](https://qvault.io/), an open-source password manager that specializes in cryptocurrency. Qvault uses Electron and has a Serverless component that uses Golang. It’s all hosted on AWS.

If you were ever wondering how Serverless works in the context of building a native or web application this episode is going to be a good listen. We talk about how different AWS services all come together to make it work. We also talk about a Serverless framework called…Serverless!

Lane on Twitter: [@wagslane](https://twitter.com/wagslane)

Lane on Dev.to: [wagslane](https://dev.to/wagslane)

Lane on Medium: [@wagslane](https://medium.com/@wagslane)

Download Qvault: [https://qvault.io](https://qvault.io/)

Star our Github: [https://github.com/q-vault/qvault](https://github.com/q-vault/qvault)

The post [Qvault’s Lead Engineer Interviewed on “Running in Production”](https://qvault.io/2019/12/09/qvaults-lead-engineer-interviewed-on-running-in-production/) appeared first on [Qvault](https://qvault.io).
What's up, doc? Rust doctests and you
Tags: rust, testing
Published: 2019-12-09 14:16:40

Rust has an interesting feature in its documentation system: if you're writing a library, it will actually compile and run the examples you give in your rustdoc comments as tests. This took me by surprise because I typically don't expect the documentation examples to immediately work, but I see why this is being done - and it's all to do with the fairly obvious: people will copy and paste examples from docs into their code.

![Advanced Copying And Pasting From The Docs](https://thepracticaldev.s3.amazonaws.com/i/3prxmcldagot6glszb22.png)

So, doctests try to ensure that the examples you give in your doc comments will actually work. Cool, how do we make use of that?

## Denial: Not a river in Egypt

You can ignore doctests. Sometimes you may just want to let an example be an example and not be considered a test.

{% gist https://gist.github.com/FLamparski/8eb0f70ab06646794eba9be4f807dba5 file=ignore_doctest.rs %}

## Acceptance: Let it go

You can also just let doctest run your code examples. What you need to keep in mind is that you will need to `use` all your types inside the example, like so:

{% gist https://gist.github.com/FLamparski/8eb0f70ab06646794eba9be4f807dba5 file=simple_run.rs %}

## Enlightenment: Writing examples as tests

Tests in Rust are fairly simple - any function that either returns `()` or panics can be a test, and your doctests can be used as regular tests, with asserts and everything:

{% gist https://gist.github.com/FLamparski/8eb0f70ab06646794eba9be4f807dba5 file=test_run.rs %}

## Galaxy brain: _hiding_ the tests in your docs

But what if you don't actually want to put all the test code and boilerplate in the documentation example itself? Well, rust has you covered too:

{% gist https://gist.github.com/FLamparski/8eb0f70ab06646794eba9be4f807dba5 file=test_with_hidden_code.rs %}

And note how this will look in the generated HTML docs:

![The last example doesn't show the boilerplate code](https://thepracticaldev.s3.amazonaws.com/i/tgoav5874txvljdqn8o7.png)

(Also see the little warning label on the first example? That's because we marked the first example as an ignored test, and the docs will make a note of that - so that's an incentive to keep your doctests passing.)

## Even more

Those are just the basics of doctests in Rust, and if you write libraries in this language, you should definitely check out the [documentation tests](https://doc.rust-lang.org/rustdoc/documentation-tests.html) manual for more - and I bet those examples are also tested 🤯
How to merge Kubernetes kubectl config files
Tags: kubernetes, cli, tips
Published: 2019-12-09 14:09:10

Sometimes when working with a new Kubernetes cluster you will be given a config file to use when authenticating with the cluster. This file should be placed at `~/.kube/config`. However you may already have an existing config file at that location and you need to merge them together.

Here is a quick command you can run to merge your two config files.

```console
# Make a copy of your existing config
$ cp ~/.kube/config ~/.kube/config.bak

# Merge the two config files together into a new config file
$ KUBECONFIG=~/.kube/config:/path/to/new/config kubectl config view --flatten > /tmp/config

# Replace your old config with the new merged config
$ mv /tmp/config ~/.kube/config

# (optional) Delete the backup once you confirm everything worked ok
$ rm ~/.kube/config.bak
```

Here is all of that (except the cleanup) as a one-liner.

```console
$ cp ~/.kube/config ~/.kube/config.bak && KUBECONFIG=~/.kube/config:/path/to/new/config kubectl config view --flatten > /tmp/config && mv /tmp/config ~/.kube/config
```
Just discovered Interactive Sandboxes in O'Reilly Learning!
Published: 2019-12-09 13:11:41

I've renewed my subscription with [O'Reilly Online Learning](https://learning.oreilly.com/). A subscription would set you back at US$399 per year. I got their Cyber Monday promo so I got it for $200 off. Before they only have online access to technical books but now they are now offering video courses and sandboxes!

I was looking for something to read and I just discovered these new features. I think they call them Interactive Sandboxes.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/rjo1hjjrha68u6kvqhxo.png)

They have now have sandboxes for Ubuntu, Kubernetes, Python and TensorFlow. Below are some screenshots I took.

## Ubuntu Sandbox
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ug8daw5kad11bw5xp8gr.png)

I installed Go. :)
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/kgekxqzjq4l45g0p2ga5.png)

VSCode is even available in the sandbox.
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/3599qs16xtvrsf9kazkl.png)

Editing Go code in the IDE
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/dt5uauvlp9n8z9utsfl8.png)

Weave Scope - I guess this can be used to visualise docker containers.
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/487nzvw8s2yerksnotlr.png)

## Kubernetes Sandbox
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/mbqnvg3dwb1bzn5lln0l.png)

## Python Sandbox
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/t39msnnwnpdwsqeq63fp.png)

Disclaimer: I am not paid by O'Reilly for this post. Just wanted to share since these new features can be useful for learning while reading a technical book without having to bring up an environment to code in.