teleren/devto huggingface dataset:
Summarising Elm scaling strategy
Tags: elm, scaling
Published: 2018-04-17 08:36:31

---
title: Summarising Elm scaling strategy
published: true
description: 
tags: elm, scaling
---

Rewatched Richard Feldman's talk on scaling Elm apps from Elm Europe 2017. You may have seen it. I was at the event but more has sunk in on repetition. 

{% youtube DoA4Txr4GUs %}

This is a superb talk about not breaking up your update, model and msg definitions when no reusability is required or intended. Breaking up code prematurely is a common tendency especially if you've come from the OO world. 

Evan Czaplicki said in his 'life of a file talk' at the same event that Javascript thinking also leads to breaking everything up into smaller files and modules as soon as possible, if only to avoid bugs from unintended mutations. 
{% youtube XpDsk374LDE %}

For update especially, the idea is to avoid unnecessary separate mini-update functions that return model and cmd and have to be mapped back to the main update function.

Instead Feldman says to break out smaller functions from within update branches that have got too big. Give these functions the narrowest possible arguments and return the minimum required. 

This makes debugging easier since you can see more rapidly what parts of the code are relevant by the type signatures, and your upgrade function is more scannable.

To avoid breaking up the messages definition and the model, the idea is to create functions that use extensible records - think polymorphism - 'focus on functions that take a subset of the model'. Again, what this does is keep the type signatures narrow and therefore more debuggable.

The legitimate time that you need to break out into a separate model, messages, update, view is for a reusable 'component' that has it's own state. Obviously if you are repeating use of a function then it may be necessary to have a separate copy of the state for each usage. 

In this case html.map and cmd.map are your friends for merging the result back. You should also pass and return what you like, or the minimum, not just be sending msg, model and getting back model, cmd msg every time unnecessarily.

In summary Feldman's theme was to make things 'small enough to fit in our heads' but not introduce unnecessary complexity. Keep this goal in mind, and don't get caught up in thinking from other languages that may not be effective.
Opinions on externally controlled promises?
Tags: javascript, es6, discuss, patterns
Published: 2018-04-17 07:50:31

---
title: Opinions on externally controlled promises?
published: true
description: Promise resolution best practices
tags: javascript,es6,discuss,patterns
---

It's become a convenient pattern on my team to store resolve functions on an external object when coordinating some async work. Does anyone else use promises like this? Maybe there are some unforeseen pitfalls?

For instance, let's say we're loading images and doing some canvas draws with them.

```javascript
class CatPichurs {
  constructor() {
    // promise control
    this.cats = {
      felix: {
        promise: new Promise(resolve => this.resolveFelix = resolve)
      },
      cheshire: {
        promise: new Promise(resolve => this.resolveCheshire = resolve)
      },
      garfield: {
        promise: new Promise(resolve => this.resolveGarfield = resolve)
      }
    }
    
    Promise.all([
      this.cats.felix.promise, 
      this.cats.cheshire.promise, 
      this.cats.garfield.promise
    ])
    .then(allTheCats => {
      allTheCats.forEach(cat => {
        // some big reveal logic
      })
    });
  }

}

class ExternalImageMagic {
  constructor(cats) {
    let felix, cheshire, garfield;
    
    // load some pictures and draw
    cats.resolveFelix(felix);
  
    // load more pictures and draw
    cats.resolveCheshire(cheshire);
  
    // and a couple of Garfield to draw
    cats.resolveGarfield(garfield);
  }
}

const someCats = new CatPichurs();
const imageStuff = new ExternalImageMagic(someCats);
```

While this example makes no sense, you can see how this pattern is handy for keeping the cat rendering in one place and the image manipulation in another while ensuring both of them are coordinated.

What does the dev community think?
Makefiles to Rule Them All
Tags: productivity, devtips
Published: 2018-04-17 07:03:43

---
title: Makefiles to Rule Them All
published: true
tags: productivity, devtips
canonical_url: https://xam.io/2018/makefiles/
---

In my [last blogpost](https://dev.to/maxlmator/adding-a-microblog-to-jekyll-39cp) you might have already stumbled over me using a [Makefile](https://www.gnu.org/software/make/manual/make.html) to simplify a project task. My enthusiasm for Makefiles goes a bit further and I add one to most of my projects by now. Here is why I do this and how they make my everyday developer life a bit easier.

None of my projects is written in C or C++ which rely on a Makefile for compiling them. Instead my projects are written in JavaScript (Node), Ruby and PHP. I use the make command as a wrapper for the individual tools coming with each ecosystem to create a common interface. This way I can just run `make test` no matter whether the tests are in JavaScript and use [Mocha](https://mochajs.org/) or use [PHPUnit](https://phpunit.de/).

Besides the different set of tools belonging to a platform (e.g. Node’s [npm](https://www.npmjs.com/), PHP’s [Composer](https://getcomposer.org/) and Ruby’s [Bundler](http://bundler.io/)) there are a few more difference between projects that I created a shortcut for: To run a project locally it might be anything between `npm run`, a Docker container or a Vagrantbox. And on the plain level of a project’s structure there is also a wide variance: Everything might be in the root directory, or split in a `src/` and `docker/` directory. Every project is its own special snowflake in this regard.

After a short trial with shell scripts to do repetitive tasks always from the project root I quickly switched to use `make` instead. It’s widely available and make it easy to handle different commands. So I started to develop my strategy for Makefiles. It’s schema applies to most of my web-based projects perfectly:

- `make setup` – Does everything which might be necessary on the first setup like installing the dependencies, like run `npm install` for a node-project.
- `make run` – This will mostly default to `docker-compose up`. Or to `bundle exec jekyll serve --drafts` for this blog.
- `make test` – You might have guessed it: This one executes the unit tests of the project.

Of course it doesn’t stop there. There are often a bunch more commands which might for example trigger an existing build system like [ant](https://ant.apache.org/). Or just as an alias for the `npm scripts`. Nonetheless it’s a great shortcut saving me quite some time when switching between projects.

A small example for a PHP project, which uses Composer and comes with a Docker-Compose setup. The tests are executed within the Docker container.

```makefile
.PHONY: setup
setup:
	@cd src/ && \
	composer install

.PHONY: test
test:
	docker-compose run web /bin/bash -c 'composer test' && exit

.PHONY: run
run:
	docker-compose up -d
```

So if you also happen to often switch between diverse projects, maybe you also want to give Makefiles a try.
CS Graduates (and not): A Question
Tags: discuss, learning, career
Published: 2018-04-17 05:07:49

---
title: CS Graduates (and not): A Question 
published: true
description: What do you think self-taught developers (and formally taught developers) lack?
tags: discuss,learning,career
---

As someone who's gone through the years of learning formally and getting a CS (or CS related) degree, what kind of skills would you think the general self-taught developer lacks?

On the flip side, self-taught developers, what kind of skills would you think the general formally taught developer lacks?

I'd really love to hear both sides of this!
4 Aspects to Consider Before Investing into Custom Product Designer
Tags: ecommerce, software, internet
Published: 2018-04-17 05:03:42

---
title: 4 Aspects to Consider Before Investing into Custom Product Designer

published: true
description: If you want to stand out amongst your competitors in the competitive ecommerce market, it’s time you invest into a Custom Product Designer. Know what pointers you need to keep in mind before you configure one of these tools with your ecommerce platform.

tags: ecommerce, software, internet
---
Hands-on Domain-Driven Design with C# Book
Tags: ddd, domaindrivendesign, architecture
Published: 2018-04-16 11:17:28

---
title: Hands-on Domain-Driven Design with C# Book
published: true
description: The book Hands-on Domain-Driven Design with C#
tags: ddd, domain-driven design, architecture
---

Ok, it is official that my book *Hands-on Domain-Driven Design with C#*
will be published by Packt in January 2019.

Here is the [link](https://www.packtpub.com/application-development/hands-domain-driven-design-net) to the book.


## What You Will Learn
 - Discover domain complexity together with business stakeholders
 - Avoid common pitfalls when creating the domain model
 - Understand the concept of bounded context and aggregate
 - Design and build temporal models based on behavior and not only data
 - Explore benefits and drawbacks of event-sourcing
 - Figure out CQRS and to-the-point read models with projections
 - Practice building one-way flow UI with Vue.js
 - Learn how task-based UI matches with DDD principles
 - Understand how to develop complex systems in ever changing world
Magento 2 ERP integration for 2C2P
Tags: magento2, 2c2p, integration
Published: 2018-04-17 03:06:57

---
title: Magento 2 ERP integration for 2C2P
published: true
description: Why choose us? Many customer choose to abandoned cart due to the complexity of payment step. With our payment integration customer able to directly input the credit card information within Magento checkout without the need to redirect to any third parties page.http://wsoftpro.com/magento-2c2p
tags: magento2, 2c2p, integration
---
todo-list CLI with github gists
Tags: cli, github, todo, git
Published: 2018-04-17 02:40:37

---
title: todo-list CLI with github gists
published: true
description: 
tags: cli, github, todo, git
---


https://github.com/yausername/todo



[![asciicast](https://i.imgur.com/60uWiHm.png)](https://asciinema.org/a/176600)
Reveal your macOS Secrets
Tags: discuss, developertools, productivity, macos
Published: 2018-04-17 01:58:48

---
title: Reveal your macOS Secrets
published: true
canonical_url: https://www.iamdeveloper.com/posts/reveal-your-macos-secrets-4d0i/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/bcz0ib9rl1ddretjo9xl.jpg
tags: discuss, developertools, productivity, macos
---

A while back, I wrote about [My Mac Setup](https://mac.iamdeveloper.com) (yes, shameless plug 😄). I have it pretty much tweaked to make me productive, but there was one thing that always bugged me.

Every time a native dialog popped, I couldn't tab through the buttons. For whatever reason, I just assumed that this was how it was in macOS but at the same time I was like how is this not available in the OS? Well tonight, I was being interrupted in my keystroke flow by a native dialog once again and hit the tipping point where I couldn't take it anymore.

A very quick Google (why did I not do this before), revealed it is indeed possible via settings buried deep in the Keyboard settings. Big thanks to this article, [Use the Tab Key to Switch Between Dialog Buttons in Mac OS X](http://osxdaily.com/2010/02/26/use-the-tab-key-to-switch-between-dialog-buttons-in-mac-os-x). I am now a happy camper.

What other hidden macOS secrets or unobvious settings do you know that could help another dev out?

Photo care of Flickr user [paultarr](https://www.flickr.com/photos/92442726@N02/8402765138/in/photolist-dNwnk1-641NHp-dN1SXG-7LEZYr-5KUUA-3ngBht-dcKg1C-bzrxia-a5iTaN-7crwgb-4TyiFu-4MjV7t-6WhpgR-9dg9cs-9hDBt5-5aSRmz-iUTtod-2Fruqc-su653-4tidA7-5Z5j7o-9dyevR-8Bm7iV-jojh6-4oaDnu-7FSUUK-6Qw2JB-jmSyA-cdqTXL-FGhpu-6CyVD5-7R4V7K-9GaUZK-6AzevT-5Jvhc4-81Sjv5-9cBUkA-7JNFNx-yChoD-4aQedB-8tsh3J-oUXdD1-b8JDKT-MF4mw-EPGVfP-Dy95RZ-7f4A8v-auDMJc-fpMrkj-aWxnUe).
Tell me about the things you don't post on GitHub
Tags: discuss, life
Published: 2018-04-16 23:54:05

---
title: Tell me about the things you don't post on GitHub
published: true
description: I am interested to learn what your secret projects are.
tags: discuss, life
---

I support the open source world and everything it stands for for more reasons than I can explain in a lifetime but I do have projects I don't share on GitHub or NPM or anywhere else. I have many vague reasons and suspicions why I am currently keeping them to myself.

I am interested to learn what your secret projects are and why you are not sharing them with the world (yet). Is it because they are not finished, are you a perfectionist? Is it unique and do you want to prevent someone from stealing it? Do you want to sell it? Is intellectual property and recognition important to you?

This will help me make better sense of why these projects matter so much to me and others don't.

_ps. #life tag anybody?_
Is WSL enough to Switch
Tags: wsl, development
Published: 2018-04-16 22:44:34

---
title: Is WSL enough to Switch
published: true
description: 
tags: wsl, development
---

So I’m not expecting people to say no because of Windows privacy concerns. I’m looking for peoples opinion if WSL is at a point that you switch from Linux or Mac to development fully in WSL?

I am seriously considering it.
Time for an Organisation Defrag
Tags: microservices, software, api
Published: 2018-04-16 22:43:57

---
title: Time for an Organisation Defrag
published: true
description: Moving organisations IT estate to a new agile, rapid and responsive design and solutions feels like a complete defrag. But how should you approach it?
tags: microservices, software, API
---
For those old enough to remember the days where you would close your eyes before starting the disk defragging process, go and make a coffee, the entire time fingers crossed in the hope that you still had a working computer when you came back.

Over that last couple of years, moving organisations IT estate to a new agile, rapid and responsive design and solutions has felt a little like that.

Actually, organic growth of an organisations IT estate is very similar to the problem disk defragging fixes; siloed applications, poor performance, misused space, delays, and nobody wants to change or fix anything due to fear.

So, what can the now practised discipline of disk defragging teach us about changing our organisation?

Analysis

Understanding the problem is critical. First thing first, you need to completely define and catalogue the estate you are trying to change. Without understanding the interaction between applications you will never be able to define how to get them efficient.

Prioritise

Now that we have a catalogue and definition of how the estate interacts we can define the priority of change based on several parts of your organisation ethos; the appetite for risk, time available to implement change and current understanding of application in question.

Change

Our advice, start small!! Now that we have identified and prioritised the problem we need to fix you need to understand if the team and organisation are ready for it. Start with a simple, well-understood application that has a tangible impact on the day to day running of the business and start a small team to improve all or part of it. From here, it's a publicity machine... Create rapid success, shout about it and continue to push.

So, how can alphie.io help?

Getting investment for large-scale change can be difficult but this is where we come in. To test the concept and start to move your organisation into an agile and responsive business alphie can be that stepping stone to prove the process while knowing you can scale as required. Our platform service lets you start your team tomorrow and deliver rapidly all at minimal cost.

Become part of that change by registering @ https://www.alphie.io/ and get 14 days free - no credit card or anything required to register.
How to begin a project with just an idea
Tags: discuss
Published: 2018-04-16 20:05:27

---
title: How to begin a project with just an idea
published: true
description: 
tags: Discuss
---

Hi, I have an idea of an application, I'm excited about it, I'm a junior, I'm good with my stack so I have no technical problems, the problem is, how do I start, and from where, how to collect my ideas to form a solid shape of a project. I feel if I started writing down all the details, it'd be time consuming and distract me.
so is there methodologies (for programmers) to learn how to organize a new project, to keep it interesting and maintained?
Configuration Drift: Phoenix Server vs Snowflake Server Comic
Tags: devops, explainlikeimfive, deployment, beginners
Published: 2018-04-16 19:42:16

---
title:  Configuration Drift: Phoenix Server vs Snowflake Server Comic
published: true
description:  Get started with immutable infrastructure with this fun comic explaining the differences between snowflake servers and phoenix servers.
tags: #devops, #explainlikeimfive, #deployment, #beginners
canonical_url: https://www.digitalocean.com/community/tutorials/configuration-drift-phoenix-server-vs-snowflake-server-comic
cover_image: https://thepracticaldev.s3.amazonaws.com/i/vmkc36dwqhbtt2il4414.png
---

By: Teddy Hose, Masami Kubo, [Hazel Virdo](https://dev.to/hazelnut)

**Note:** This comic adaptation covers a portion of an article on immutable infrastructure. If you'd like to learn more, we recommend taking a look at the original piece: [What Is Immutable Infrastructure?](https://dev.to/digitalocean/what-is-immutable-infrastructure-2h1o)

![Phoenix server vs Snowflake Server](http://assets.digitalocean.com/articles/configuration_drift_comic/phoenix-snowflake_comic_r2_1490x3020.png)



**Build, test, and deploy something new on DigitalOcean - the all-in-one cloud platform developers and their teams love. Get started with a free $100 account credit for new users: [do.co/devto](http://do.co/devto)**


<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.
Linux LDAP Server
Tags: linux, beginners, opensource
Published: 2018-04-16 19:09:18

---
title: Linux LDAP Server
published: true
description: 
tags: #linux #beginners #opensource
---

1 What is LDAP?
2 Uses of LDAP
3 LDAP Server Implementations
4 Installing OpenLDAP
5 Configuring LDAP
6 LDAP Terminology
7 Modifying Entries
8 Adding Entries
9 Adding Organizational Units
10 Adding Users
11 Adding Groups
12 Deleting Entries
13 LDAP Port
14 Authenticating Users with LDAP
15 Using LDAP web interface (phpldapadmin)

https://likegeeks.com/linux-ldap-server/

Hope you like it.

Thanks in advance.
Write a script to find permutable prime numbers
Tags: challenge
Published: 2018-04-16 18:54:52

---
title: Write a script to find permutable prime numbers
published: true
tags: challenge
---

Another quick challenge via Fermat's Library:

{% tweet 964139748230160389 %}

Via [Wikipedia](https://en.wikipedia.org/wiki/Permutable_prime):
> A permutable prime, also known as anagrammatic prime, is a prime number which, in a given base, can have its digits' positions switched through any permutation and still be a prime number.

Here is the list of permutable primers under 1,000:
> 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, 97, 113, 131, 199, 311, 337, 373, 733, 919, 991

In the language of your choice, **write a script to find permutable primes**.

Happy coding! 🤓
Should I carry on with Django or Node.js?
Tags: python, javascript, node, django
Published: 2018-04-16 17:18:20

---
title: Should I carry on with Django or Node.js?
published: true
description: same question I had with Python and JS for long run
tags: python, javascript, node.js, django
---

Hello everyone I'm just another fellow beginner, I've been trying to learn Node.js from mostly YouTube videos and MDN and other online resources. (learnyounode, FreeCodeCamp) also created simple To-Do app, a login app, now I'm trying to create a simple blog website with Node.js Express.js and server side rendering with `.ejs` but somehow I feel like bit weird and overwhelming while using so many libraries and/or functions like 

* CORS,
* JWT,
* passport.js for login signup and creating local strategy'
* body-parser (which I still forget to understand that why we needed it in first place.)
* cookie-session ( which I understood only because of passport.js)


2 months ago I was practicing I've created simple blog site and and a photo collections library site with Pytho- Django 2 months ago and I felt a little comfortable as Python itself feels more organised and well structured, I have heard that Django is just another framework not a run time like Node.js is, and it really provide many inbuilt facilities. 

* I'm a little more Comfy with Python is because during college and elsewhere I've practice DS & Algorithms in Java and C and that's why I can also try that in Python but in JS its not the case. Moreover, I'm still trying to practice more DS & Algorithms with geeksforgeeks.org 

But right now I feel lost with Node.js every single day, and don't know how to proceed creating blog (particularly I've just implemented the login signup thing and yet to create the blog post model). You might wonder why am I juggling? That is because after looking at angelList (here in India) there are more opportunities with Node. I hope to start applying soon and land at some intriguing work place, I am under such a pressure from parents for that. 

What are your thoughts on this?
Who's looking for open source contributors? (April 16 edition)
Tags: opensource, discuss
Published: 2018-04-16 16:16:14

---
title: Who's looking for open source contributors? (April 16 edition)
published: true
description: 
tags: opensource, discuss
---

Anybody working on an open source project and looking for contributors?

## Post here shamelessly!

If you posted in a previous one of these threads, feel free to re-post here.
Learning Chinese with Python
Tags: python, chinese, pinyin, showdev
Published: 2018-04-16 16:05:18

---
layout: post
title: Learning Chinese with Python
description: How am I using Python to learn 中文
published: true
category: [python]
tags: [python, chinese, pinyin, showdev]
---

# Intro
I have been learning Chinese since 2016.  Unfortunately it goes slowly but from time to time I receive some task to prepare.  Then I need to cover some material in that language.  Then text is written in my language (Polish) or English and in Chinese characters.  I can barely recognize 20 or 50 of them so Pinyin is a must.  And because on a daily basis I am using Python I thought: let us see how to use it to automate my work.

# Python is great
It has tools for everything.  It took me only minutes to find nice libraries for segmentation, group characters into words (the leader is `jieba`)  and then to use pinyin transliteration (`xpinyin` is one of the many examples).  This is how easy it is to be done in Python
```python
import jieba
from xpinyin import Pinyin

sentence = "我想说更好的中文，但很难，因为我是波兰人"
print(sentence)

segments = jieba.cut(sentence)
output = " ".join(segments)
print(output)

p = Pinyin()
pinyined = p.get_pinyin(output, splitter='', show_tone_marks=True)
print(pinyined)
```
It will produce output:
```bash
我想说更好的中文，但很难，因为我是波兰人
Building prefix dict from the default dictionary ...
Dumping model to file cache /tmp/jieba.cache
Loading model cost 0.899 seconds.
Prefix dict has been built succesfully.
我 想 说 更好 的 中文 ， 但 很 难 ， 因为 我 是 波兰人
wǒ xiǎng shuō gènghǎo de zhōngwén ， dàn hěn nán ， yīnwèi wǒ shì bōlánrén
```
Cool isn't it?
Now I can use it to document processing, thus making my work much faster now.