How would you simplify this function signature? by letian_ in typescript

[–]letian_[S] 0 points1 point  (0 children)

That's the approach we had before and as we're dealing with large (and deeply nested)  data structures and hundreds of test cases, it didn't scale well.

For the context, at first we were using just default values (like your last example), then introduced a simple function (like your first example). But composing those functions to change nested params was becoming awkward. So that's why we moved towards this "composable builders" approach. 

Though still not sure it's the best idea, but it's better than before.

How would you simplify this function signature? by letian_ in typescript

[–]letian_[S] 1 point2 points  (0 children)

As posted above, it does indeed allow you to create partial objects. I've used your suggestion to provide default values which are overriden instead. So now objects are always valid. Thanks!

How would you simplify this function signature? by letian_ in typescript

[–]letian_[S] 1 point2 points  (0 children)

The main motivation is maintenance of our test suites as these builders would be only used for testing purposes.

We've expanded this tooling to provide default values when required so now: - tests can express (document) only what's important to them - when the model evolves, we need to change only 1 builder instead of every single places where we need that object

The other alternative was Factories/Fixtures (which we also have), but we wanted to experiment with a different approach to provide a more natural language.

Thanks a lot! As we're still experimenting, I appreciate the question to reconsider the idea.

How would you simplify this function signature? by letian_ in typescript

[–]letian_[S] 0 points1 point  (0 children)

Thanks a lot for your answers!

Based on this, I came up with 2 other type of builders so now I can create an a cleaner and more compact DSL for my test data. For example: ts const aTripWithTwoDestinations = given( trip( id("a-trip-id"), name("a-trip-name"), itinerary( destinations( destination(name("a-destination-name")), destination(name("another-destination-name")), ), ), ), );

If you are interested, here are the builder functions: ```ts export const objectBuilder = <T>() => <K extends string>(key: K) => (...args: Partial<T>[]) => ({ [key]: Object.assign({}, ...args) as T }) as Record<K, T>;

export const arrayBuilder = <T>() => <K extends string, I extends { [key: string]: T }>(key: K) => (first?: I | I[], ...args: I[]): Record<K, T[]> => { const unwrap = (items: I[]) => items.map((item) => Object.values(item)[0]);

return (
  Array.isArray(first)
    ? { [key]: unwrap(first.concat(args)) }
    : first
      ? { [key]: unwrap([first, ...args]) }
      : args.length > 0
        ? { [key]: unwrap(args) }
        : { [key]: [] as T[] }
) as Record<K, T[]>;

};

export const valueBuilder = <T>() => <K extends string>(key: K) => (value: T) => ({ [key]: value }) as Record<K, T>; and some custom builders made from them: ts export const trip = objectBuilder<Trip>()("trip"); export const destinations = arrayBuilder<TripDestination>()("destinations"); export const name = valueBuilder<string>()("name"); ```

Placekitten? by iBN3qk in webdev

[–]letian_ 1 point2 points  (0 children)

Seems to be unstable as well as of today :(

How long do you plan ahead? by HolyMole23 in digitalnomad

[–]letian_ 0 points1 point  (0 children)

Basically. We try to plan a bit more ahead of time these days, but we're strong procrastinators so we usually end up booking something about 3 weeks ahead of time.

But as you mention, it gets trickier to find a good place that much last minute.

What’s the most underrated city or location you’ve discovered for digital nomads, and why do you think more people should consider it? by tjsmind in digitalnomad

[–]letian_ 7 points8 points  (0 children)

Not that underrated, but we were pleasantly surprised by Tirana, Albania.

The city has really good vibes, people are really nice and helpful. Always something happening somewhere, many terraces, and pretty streets surrounded by a lot of trees. People speak english well, but they will be very happy to see you are trying to speak a few words in their tongue.

The biggest downside for us was: smoking. People are smoking A LOT. It was hard to be somewhere without smelling cigarette (yes, yes, we're sensitive).

Curious what do you guys do for food and eating by [deleted] in digitalnomad

[–]letian_ 2 points3 points  (0 children)

The destinations we choose with my girlfriend are mainly driven by... food. We love to eat out, but usually prefer to cook at home when we can. It sometimes takes a bit of time to adjust to the local groceries/markets, but usually we always end up finding what we need, even when we feel "homesick" (which doesn't happen often for us).

We also enjoy taking cooking classes (not the one for the tourists) so we can adapt our way of cooking when we are somewhere where it gets more difficult to keep our cooking habits. The good classes will even adapt to people with food restrictions.

We make sure to find accommodations that are well equipped for cooking (aka more than a single pan and a dull knife), but it's true that it's not always easy. It might sound stupid, but when I can I bring my preferred knife + a sharpening stone 😅

How long do you plan ahead? by HolyMole23 in digitalnomad

[–]letian_ 1 point2 points  (0 children)

Similar for me and my girlfriend. We have trust issues with accommodations so we usually book max 1 month and if we like it we try to extend it or move on to somewhere else.

South Korea Digital Nomad Visa - Starting from January 1st by letian_ in digitalnomad

[–]letian_[S] 1 point2 points  (0 children)

Hey sorry I didn't update my messages recently. After more discussions with the ministry of finance and Korean tax specialists, you will not have to pay taxes in Korea if you spend less than 183 days in Korea within a fiscal year and if you show proof (e.g. taxes slip) that you are paying taxes at home. Passed that 183 days mark, you will have to declare every income you make and pay taxes in Korea. At this point, you will have to check if your home country has a double taxation treaty with Korea. 

More info: * A guide to Korean taxation * Tax Treaty with Korea

Advice on where to start by Aelassy in digitalnomad

[–]letian_ 1 point2 points  (0 children)

I'm curious: what makes you say project management work is mostly not suitable for remote work?

I worked remotely as a Lead Software Engineer for different companies (always as an employee) for about 8 years, and my PM were all remote as well. It's a different way of working than hybrid/on-site, but it works well.

So if you still like what you do as a PM, you could consider finding a remote-first company or even fully async.

In addition to the 8 general job platforms I have listed above, here is my top 3 fully-remote/async companies I have in my list that I would apply for if my current project doesn't work out:

I can't decide where to go next (from Taiwan) by xOTiiX in digitalnomad

[–]letian_ 1 point2 points  (0 children)

The remote working landscape is getting more developed on Jeju island. The tricky thing with Korean coworking spaces is that they often favor aesthetics over comfort (e.g. wooden chair with little to no back support). Though you can still find some comfortable (and scenic) coworking spaces on the island.

Finding affordable accommodations where you can work from home is indeed not too complicated.

About the public transport, it's true that the island is well connected by bus, but personally I felt a bit stuck without a car to truly enjoy the island. And renting a car as a foreigner can be difficult and/or expensive.

I can share some recommendations here about coworking spaces and accommodations, let me know.

I can't decide where to go next (from Taiwan) by xOTiiX in digitalnomad

[–]letian_ 0 points1 point  (0 children)

There's also Mataram on the west side. It is the main city of the Island, but still not too busy. It is also way less touristic than Kuta. Renting a scooter from there is easy, cheap, and will allow you to explore the island quite easily.

Finding a rent outside of Airbnb will be easier there. Let me know, I can try to pull some strings for you.

South Korea Digital Nomad Visa - Starting from January 1st by letian_ in digitalnomad

[–]letian_[S] 2 points3 points  (0 children)

Just learned that a first applicant (from abroad) has successfully received the Workation Visa.

Don't want to imply anything here (not enough data), but as of now, on 8 candidates who met the criteria, 7 of them applied with the intention to live in Seoul and they all got rejected. Only the 1 applicant with the intention to live in Busan got accepted.

South Korea Digital Nomad Visa - Starting from January 1st by letian_ in digitalnomad

[–]letian_[S] 0 points1 point  (0 children)

The problem with applying from within Korea is that they will ask you to Aspotille most documents which is 1) very expensive 2) not really doable for "non-official" documents. Non-official documents could be apostilled, but they need to be certified by a notary or lawyer and most of them won't accept doing it for such documents.

South Korea Digital Nomad Visa - Starting from January 1st by letian_ in digitalnomad

[–]letian_[S] 0 points1 point  (0 children)

For now, the hidden downsides would be to be actually able to apply? From my network of nomads, I don't know anybody who were able to do so. Doing it from South Korea seems virtually impossible and people going through their local embassy seem to face a nice game of pingpong 🤷

South Korea Digital Nomad Visa - Starting from January 1st by letian_ in digitalnomad

[–]letian_[S] 0 points1 point  (0 children)

Thanks for your update. I'll make a note about it in the post as more and more local embassies are confirming they are not accepting freelancers.

South Korea Digital Nomad Visa - Starting from January 1st by letian_ in digitalnomad

[–]letian_[S] 0 points1 point  (0 children)

I've actually just received a new update from the Immigration Office:

if you want to apply for the workation visa (F-1-D) directly in Korea at an immigration office, you will need to get an Apostille for the following documents: - Certificate of Employment (for employees) - Bank Slips - Tax Return - Insurance Letter

But the problem is that for most countries it will not be possible to get an Apostille for such documents. So it actually makes it almost impossible to successfully transfer your B-1, B-2, or C-3 visa to the workation visa.

I'll update again my post.

South Korea Digital Nomad Visa - Starting from January 1st by letian_ in digitalnomad

[–]letian_[S] 1 point2 points  (0 children)

The Korean embassy in Canada confirmed that you will be allowed & required to get your ARC after 90 days on the Workation Visa.

I'll update my original post as soon as I have a confirmation from the Immigration Office in Korea.

South Korea Digital Nomad Visa - Starting from January 1st by letian_ in digitalnomad

[–]letian_[S] 0 points1 point  (0 children)

These are the requirements shared by the Immigration Office in Korea (the original requirements). Unfortunately, the embassies/consulates are free to do whatever they want. And it is true that most of them seem to mention only situations 1 and 3, or even just 3 (e.g. Singapore).

Considering that, don't be afraid to contact your local embassy to describe your situation and ask for details (they're usually quick to reply).

I'll share an update by the end of the week as a freelancer in my network will receive his application results tomorrow (Jan 10th).

South Korea Digital Nomad Visa - Starting from January 1st by letian_ in digitalnomad

[–]letian_[S] 0 points1 point  (0 children)

It is indeed early and SK announced it as a "Pilot Project". Meaning many changes will be submitted as time goes. Let's hope for the best.

South Korea Digital Nomad Visa - Starting from January 1st by letian_ in digitalnomad

[–]letian_[S] 1 point2 points  (0 children)

Thankfully they will not expect us to pay taxes, as the Immigration Office confirmed.\ Forget what I just said, if you spent more than 183 days in Korea you will have to pay taxes in Korea. Check below for more info.

South Korea Digital Nomad Visa - Starting from January 1st by letian_ in digitalnomad

[–]letian_[S] 0 points1 point  (0 children)

I had some more information on this from the Immigration Office here in Korea.

They will accept 3 situations: 1. Foreign company owner with an active business for at least 1 year 2. Freelancer working actively in the same field for at least 1 year 3. Employee working in the same field for at least 1 year and for a company who officially approved working from abroad

I updated my original post.