teleren/devto huggingface dataset:
How to add custom options to WooCommerce products via Uni CPO
Tags: woocommerce, productoptions, ecommerce
Published: 2018-06-23 11:52:08

---
title: How to add custom options to WooCommerce products via Uni CPO
published: true
description: The article describes how to add custom options to your WooCommerce product by using Uni CPO plugin.
tags: woocommerce, productoptions, ecommerce
---

Uni CPO WooCommerce Options and Price Calculation Formulas plugin gives a possibility to add custom (extra) options to you WooCommerce based products. Having custom options are vital for some products, especially those which depend on customer-defined values/customization choices. Uni CPO plugin can help you to create a price quoting calculator for your product and a possibility to order the product with the quoted configuration instantly.

The video version is available here: https://www.youtube.com/watch?v=dX7-T4gVJ_I

The free version of the plugin is available here: https://wordpress.org/plugins/uni-woo-custom-product-options/ So, go and grab it and install it along with WooCommerce. Now create a product and set its price to smth. Actually, anything, even '1'. This is needed so WC will not treat the product as free. That's all you need to begin product configuration.

Uni CPO has a quite powerful visual form builder. However, it is very easy to use and intuitive. So, activate the builder mode. Add a row by dragging and dropping a module with such a name from the builder panel. Do the same for a column. Now this is the time for custom options. Add Text Input option (again, by dragging and dropping it from the builder panel). Hover it and click on the cogs icon - option's settings modal window will be opened. Define option's slug and other settings such as make it required, step value, default value etc. Save the option.

Create a copy of the whole column - this action leads to duplicating both the column and the option. This is a faster way to add a similar option. Repeat option's configuration but choose a different slug name and save it then.

Now you have two custom options - width and height. Save the builder content by clicking "Save" button on the builder panel. Now open "Formula and conditional logic" modal window and define your price calculation formula. It is as is as writing an arbitrary maths formula. Save it.

Click on "Product general settings" icon on the builder panel and open the modal window with product-specific general options. Enable two first settings here. These are "displaying custom options" and "enable product price calculation". Save the settings.

That's all! Your product has two custom extra options - width and height - and price calculation based on the values of these options. Easy, huh? :)

Also, please, check the pro version of the plugin: https://builderius.io/cpo/ It has a lot more features, tons of features!
Articles on getting up to speed on a new job?
Tags: discuss, tips
Published: 2018-06-23 10:56:56

---
title: Articles on getting up to speed on a new job?
published: true
tags: discuss, tips, 
---

Hi, 

Sorry if this is the wrong place to ask this, but a while ago I read an article that I think I found here (could be wrong, it could be HN or Twitter or reddit), but the article includes some questions that one can ask to get productive quickly on a new programming job. 

I don't remember much about it, but I remember finding it to be incredibly helpful in getting up to speed with my then-new job, and one of the tips is to ask something along the line of "whats the biggest pain you're facing in the development right now?" or "whats something you would really like to change with the system but couldn't".. 

A friend of mine will be starting a new job soon and I would like to forward the article to them, but I have since lost the link. 

Anyone have a guess on what I was referring to? Or if anyone has any other article that you would recommend on the topic?
Introducing Fusuma: A helper for creating slides with markdown
Tags: javascript, react, markdown, tools
Published: 2018-06-22 23:03:02

---
title: Introducing Fusuma: A helper for creating slides with markdown
published: true
description: Introduce tools that can make slides using CLI.
tags: javascript,react,markdown,tools
---

{% github hiroppy/fusuma %}

# Goal
Created a CLI that supports to release with 1 command without writing webpack, Babel, Postcss, etc setting file.

And make a slide with markdown only.

It can quickly create a slide and publish it to gh-pages.

# Demo
slide: https://slides.hiroppy.me/the-present-and-future-of-JavaScript/
repo: https://github.com/hiroppy/slides/tree/master/slides/the-present-and-future-of-JavaScript

slide: https://hiroppy.github.io/fusuma/fx/
repo: https://github.com/hiroppy/fusuma/tree/master/samples/fx

# Procedure
You just execute the following three lines for executing, generating and deploying slides.

```
$ npm i fusuma -D
$ npx fusuma init 
$ mkdir slides && touch slides/title.md && echo '# Hello😄' > slides/title.md

# --- executable tasks---
$ npx fusuma start    # development
$ npx fusuma build    # production as NODE_ENV=production
$ npx fusuma deploy   # deploy to github pages
$ npx fusuma pdf      # export as PDF from HTML

# --- Tree ---
$ tree -a
.
├── .fusumarc.yml
└── slides
    └── title.md

1 directory, 2 files
```

When `npx fusuma start` is executed, it is output as follows.
![](https://raw.githubusercontent.com/hiroppy/fusuma/master/media/procedure-screenshot.png)

Default theme is bespoke-theme-nebula.

And only `.fusumarc.js` and `slides/` are necessary files at the time of execution.

# Tasks
Fusuma supports the following tasks.

- `init`: generate the configuration file(.fusumarc.js)
- `start`: run with webpack-dev-server
- `build`: build with webpack4
- `deploy`: upload the prebuilt files to gh-pages
- `pdf`: convert prebuilt files from HTML to pdf

# What it can do / What it can not do

## What it can do

- development, build, and deploy can be done with one command
- presenter mode
  - https://github.com/hiroppy/fusuma#presenter-mode
- a table of contents is created in Sidebar
- can extend css and js
- can set OGP and SNS
- etc…

## What it can not do
Expressing animation is difficult because a slide is written by Markdown.
However, you can write a slide as HTML and extend JS.

---

If you interested in Fusuma, please see this repository😍

https://github.com/hiroppy/fusuma

Thanks!
Adding Spotify's missing features and learning about JS, (S)CSS, PHP, APIs, Skeuomorphic Design and Documentation
Tags: api, php, javascript
Published: 2018-06-23 08:56:27

---
title: Adding Spotify's missing features and learning about JS, (S)CSS, PHP, APIs, Skeuomorphic Design and Documentation
published: true
description: Developing software not only means creating stuff but also learning things.
tags: api, php, javascript
---

*This is the TL;DR section of a much - much!! - longer article over on my dev-blog. Feel free to visit the [original article][1].*

When suddenly songs in my Spotify playlists were not available anymore but an alternative version (remastered album, best-of album) could still be found, I had to add a missing feature to Spotify.

[My software][2] would find "unavailable" tracks and search for alternatives. The user could then add one of the search results to a "revived" playlist.

In the process of writing the software, I learned a lot about writing software in a very general term but also about language-specific topics, benefits of IDEs and how to design user interfaces.

0. I added a huge amount of comments to my code, documenting how things are done and what the code does. This does not only help myself when I review the code later on but also contributors who want to improve my software.

0. Knowing how paralyzing it can be when there are no responses to your questions confirmed me in my thinking that communication with other developers is a crucial tool to make your software accessible to more users.

0. During the process of making the application I learned about new aspects of languages familiar to me. Those aspects included type hinting in PHP, adding event listeners and dispatching events in JavaScript.

0. Writing JavaScript code without frameworks proved to be simple. Of course frameworks like jQuery simplify some tasks but is it worth all the required bandwidth?

0. Type hinting is a great tool to improve the readability of code.

0. Sass enables a developer to easily prototype the design of a software because of variables.

0. Skeuomorphic design is harder (but in my opinion more beautiful when done right) and requires you to think about your design more.

0. Release early or you might not release at all.

[1]: https://www.nitricware.com/2018/06/23/spotifys-missing-feature/
[2]: https://github.com/nitricware/SpotifyUpdater
I put an early DEV iOS app up on GitHub and would love your help!
Tags: showdev, ios, swift, meta
Published: 2018-06-22 22:36:04

---
title: I put an early DEV iOS app up on GitHub and would love your help!
published: true
description: This is a call for anyone who wants to improve it in any way.
tags: showdev, ios, swift, meta
---

I spent a bit of time building a the beginnings of an iOS app:

{% github thepracticaldev/DEV-ios %}

This is a call for anyone who wants to improve it in any way. I'm not super experienced in this arena, and neither are the other folks on the DEV team. I do think we're taking a good approach to start off (described briefly in the Readme), but you're welcome to debate me on the million ways to build native apps. 😄

By the way, we're actually getting close to open-sourcing our whole codebase. It will happen some time in July. We'll announce a target date at some point next week. We can't wait to give the code back to the community.

Thanks for being wonderful. I look forward to learning from any iOS devs who care to make an issue or PR on this project to improve it in any way.

Happy coding ❤️
Amazon Marketplace- A Fox & Rat Tale
Tags: amazonmarketplace, onlinestore, ecommerce, startup
Published: 2018-06-23 05:49:19

---
title: Amazon Marketplace- A Fox & Rat Tale
published: True
description: I am connecting the story with yours, Amazon is just like the Jackel and you being the rats. Here is the analysis for you to understand.
tags: #Amazon Marketplace #onlinestore #e-commerce #Startup
---
Are you planning to set up a #storefront in #Amazon #marketplace? or Were you part of #Amazon #marketplace.?  Just listen to the Amazon's Fox Tale. 

https://gossip.software/2018/06/21/amazons-fox-tale-to-all-e-commerce-startups/
Setting up Laravel Queue worker on Heroku
Tags: heroku, laravelqueue, laravelheroku
Published: 2018-06-23 01:17:44

---
title: Setting up Laravel Queue worker on Heroku
published: true
description: Get Laravel Queue worker up and running on Heroku
tags: heroku, laravelqueue, laravelheroku
cover_image: https://postsrc.com/storage/quzZMWnnDLALD6xQs8XVTmpLdb2gtRfZfiVAQT0A.jpg
---
Setting up Laravel Queue worker on Heroku is quite straightforward. All you have to do is define the queue configuration on the Procfile that’s located on the root level of the project directory as well as spin up a new Herokku dyno instance.

To define the queue, you have to name the queue first (which can be anything that you want) `sqs: php artisan queue:work --timeout=1800` and then continue with the `php artisan queue:work` command to ensure it’s running.

You can also pass any of the flags that’s provided by the queue:work command depending on your needs. The next steps that you have to do is to deploy the Laravel application to Heroku so that your online application gets updated.

Next, you have to run `heroku ps:scale web=1 sqs=1 --app your-heroku-app` from your command line and this will ensure that your Laravel application has another dyno called sqs. Once you have done that, Heroku will be able to process your Laravel queues.

Article Originally written on: [PostSrc (My personal Website)](https://postsrc.com)
Can We Stop Arguing About "What Agile Is" And Focus On What's Working?
Tags: agile, career, culture, leadership
Published: 2018-06-23 01:11:53

---
title: Can We Stop Arguing About "What Agile Is" And Focus On What's Working?
published: true
description: I keep running into software developers on teams that are _jaded and disillusioned about how their company has set themselves up to be "agile"
tags: #agile #career #culture #leadership
---

I keep running into software developers on teams that are _jaded and disillusioned_ about how their company has set themselves up to be "agile".

But is agile development really the problem, or is it more how the industry has sold it to us?

[John Cutler](https://twitter.com/johncutlefish) joins me as a guest on my YouTube channel where we discuss the current skepticism around agile development in the software industry.

He writes many [popular articles on Medium](https://hackernoon.com/@johnpcutler) as part of the Hacker Noon publication, and helps companies with Product Management and improving software development outcomes.

John brings up the fact that there is an **agile/devops industrial complex** of sorts with its own agenda that might not always provide the best solution for your unique situation.

It can be easy to get caught up in this complex, and forget to ask the important question:

"_What's really working today_"?

# [📺 Watch the full interview on YouTube](https://www.youtube.com/watch?v=P1kaODKMisg&t=0s&index=2&list=PL32pD389V8xs55cCEeus188KL9WoqiwFq)

Or listen as a podcast:
[🎧 Soundcloud](https://soundcloud.com/jayme-edwards-media/john-cutler-on-agile-skepticism-and-making-an-impact)

<hr />[🔔 Subscribe for 90+ videos on healthy software development](https://YouTube.com/c/JaymeEdwardsmedia?sub_confirmation=1)
Fast way to build CRUD app?
Tags: discuss, programming
Published: 2018-06-22 21:46:58

---
title: Fast way to build CRUD app?
published: true
tags: discuss, programming 
---
I am building a CRUD app using Spring Web MVC.
The app‘s mostly about data management and has almost no interesting business logic (besides calculating a few sums). 

While it is not very difficult from a technological point of view, it just takes time to get the views, controllers and domain model wired up. Time I would rather spend on the interesting parts of the app.

Have you had similar experiences when building CRUD apps? Does the choice of framework matter? Are there faster ways to implement data management functionality than MVC frameworks?
Let's create our map method
Tags: javascript, beginners, programming
Published: 2018-06-22 19:32:57

---
title: Let's create our map method
published: true
description: 
tags: #javascript, #beginners, #programming
---

If you want to take a closer look on how JS works and how we created our own filter function, you can see my earlier post:

{% link https://dev.to/machy44/lets-create-our-own-filter-method-in-js--5gh4 %}

I think this two posts combined are a good way to find out how standard array methods work in JS. 

It's very important to know that Array.prototype.map() returns a new array which means that the old array is not mutated. (Mutation is a very important concept when you start to work with React and Redux libraries). Enough talking, now let's code. Here is a simple example how map works.

```javascript
var arr = [1,2,3];

var newArr = arr.map(function(element){
  return element + 1;
});

console.log('arr: ', arr);
// arr is not mutated and returns [1,2,3]

console.log('newArr: ', newArr );
//newArr returns [2,3,4]
```
####Now, Let's go code our own map function
In this example we will not check if the first parameter is an array or if the second parameter is a callback function, and so on. [Detailed syntax of map function you can find on developer.mozilla.org.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)

```javascript
let arr = [1,2,3];

Array.prototype.ownMap = function(callback) {
  let mappedArr = [];
  for(let i=0; i < this.length; i++) {
    mappedArr.push(callback(this[i]))
  }
  return mappedArr;
}

let newArr = arr.ownMap(function(element) {
  return element + 1;
});

console.log('arr: ', arr);
// not mutated and returns [1, 2, 3]
console.log('newArr: ', newArr);
// returns [2, 3, 4]
```
Now let's play with indexes because an index can be send as the second parameter in map callback function.

```javascript
let arr = [1,2,3,4];

Array.prototype.ownMap = function(callback) {
  let mappedArr = [];
  for(let i=0; i < this.length; i++) {
    mappedArr.push(callback(this[i], i)) // we defined i as second argument
  }
  return mappedArr;
}

let newArr = arr.ownMap(function(element, index) {
  return element + index;
});

console.log('arr: ', arr);
// not mutated and returns [1, 2, 3, 4]
console.log('newArr: ', newArr);
// returns [1, 3, 5, 7]
```

##Conclusion

When you are learning something it's always best to know how things work under the hood. Please, let me know, if there is something I didn't mention and it's good to know.
Follow Friday! (v2)
Tags: discuss, followfriday
Published: 2018-06-22 14:58:50

---
title: Follow Friday! (v2)
published: true
description: 
tags: discuss, followfriday
---

Below you can either write about **why someone might want to follow you** or **devs you think others should follow and why**. Feel free to do both.

Remember that mutual follows can message/pair via [DEV Connect](https://dev.to/connect), so you're encouraged to follow back and say hey 👋
How dead code spring up during development
Tags: programming, code, dev
Published: 2018-06-22 14:06:33

---
title: How dead code spring up during development
published: true
description: 
tags: programming, code, dev
---
![](https://refactoring.guru/images/refactoring/content/smells/dead-code-01.png)

Dead code is code that is never run, that can never be reached.
**Some manifestations of dead code include:**
* Functions that are never called
* Variables that are written but never read
* Parameters passed to an internal method that are never used
* Enums, structs, classes, or interfaces that are never used
* Features removed from an application's user interface, but the backend support code is left in.
* Wizard-generated UI code that inserts hooks that are frequently never used.

**Take Away**
* Remove dead code wherever possible. It gets in the way and slows you down.
* It is safe to remove code that you might need in the future. You can always get it back from version control.
* Code cleanup should always be made in separate commits to functional changes.
* Dead code happens in even the best codebases. Tell your code to get a life, or get lost.
What do you do when you're frustrated?
Tags: discuss
Published: 2018-06-22 13:31:13

---
title: What do you do when you're frustrated?
published: true
description: 
tags: discuss
---

Usually, I just walk away and take a break from whatever it is that I'm working on, whether it be hobbies, programming, school, etc. Then I come back with a fresh mind to be able to deal with the problem.

EDIT: I forgot to mention that I found out bashing my head against the problem doesn't work real well.
Code for Humans
Tags: code, humans, codequality, readability
Published: 2018-06-22 13:10:09

---
title: Code for Humans
published: true
description: It's great, your code works in production and is fast enough. Is it readable? maintainable? would you be able to remember the intent through time?
tags: #code, #humans, #code-quality, #readability
cover_image: https://thepracticaldev.s3.amazonaws.com/i/m7pd9s2lsjne1xt8nvh5.jpeg
---

###### white-spaces are code too...

It's great, your code works in production and is fast enough.
Congratulation, but...
- Is it readable enough?
- How easy is it for a new developer to pick it up and make all the sense?
- Does reading through the code present a good mental model of the system built?

This not an exhaustive list, but if answer to any of the above question is NO, then  you should consider revisiting and making a few cosmetic changes.

Here are a few pointers that I follow when writing/reading code
#### white-spaces
    - white-spaces are code too
    - leave a blank line between method definitions
    - a blank line when there is a changes in context within method body 

#### indentation
    - indent code well
    - follow consistent indent length, 2 spaces or 4 spaces
    - be consistent with use of tabs or spaces, choose one and stick to it across the team(s)

#### variable and method naming
    - use concise and meaningful names
    - variable names should reflect the value they refer
    - method names should reflect the process / business logic contained

#### documentation
    - unless it is a framework, module, class, method, variable names should be self documenting without need of additional documentation
    - comments should not be a tool to justify messy code segments

#### design the code
    - every code is a piece of art uniquely conceived by it's developer
    - visualise the interactions between objects before beginning to code
    - visualise message exchanges needed before beginning to code

#### right abstraction
    - abstraction does not mean hiding the complexity detail
    - know the behavioural traits to model
    - have a api spec to refer to
    - know before hand methods, variables, constants to expose
    - do not make decisions based on speculations
    - requirements are the corner stone

#### language idioms
    - make use of language idioms
    - Ruby Example: [1, 2, 3, 4].sum  v/s  [1, 2, 3, 4].each {|ele| sum = sum + ele}


## Code for Humans
<small>Cover Image Credit: [Unsplash](https://unsplash.com/photos/cvBBO4PzWPg)</small>
What are the alternatives to unit tests?
Tags: coding, discuss
Published: 2018-06-22 09:41:15

---
title: What are the alternatives to unit tests?
published: true
description: 
tags: coding, discuss
---

When I was in university, I had a lecturer who didn't like unit tests. He was an eldery man who worked at IBM and gave lectures about mainframes. He always said, the hype about unit tests would simply double the amout of code written and do nothing for its safety.

When I did my first big project in 2009, a HTTP API, nobody in the company I worked for (the company was founded in 2001) had written any unit tests. They had huge C/C++ and PHP code-bases. They did integration tests, but the project I had been given was the first that used unit-tests.

I heard about it at university and wanted to make my first project look good right from the start. So I wrote a bunch of unit tests for every `class`, ending up with about 200 tests after the first version was released. Trying to hit that famous 100% coverage. Only a few months later the architecture of the API changed and somebody new at the project hat to rewrite more than 100 tests.

In the lifetime of the project, the unit tests didn't prevent any major bugs, just the stuff I had in mind while testing the code, but they slowed down the development progress tremendously. Also, they forced some style on the code that was mostly there to ease the writing of the tests and not the resulting application.

So what is your opinion about this? Did I do unit tests wrong? Is there an alternative? Are integration tests (black- or grey-box) enough when automated? Is TDD a placebo? Are type-systems the way to go?

Lets discuss! :)