teleren/devto huggingface dataset:
Bringing In The Missing Part: A Code-Generation Tool That Makes Uber's RIBs Usable.
Tags: ribs, testing, swift, mocks
Published: 2018-11-05 23:10:24

---
title: Bringing In The Missing Part: A Code-Generation Tool That Makes Uber's RIBs Usable.
published: true
description: Introducing code-generation templates that are compatible with complex coding patterns in RIBs/RxSwift-based iOS/MacOS applications to enable automatic code-generation of protocol mock classes for unit-testing.
tags: RIBs, testing, Swift, mocks
cover_image: https://thepracticaldev.s3.amazonaws.com/i/7t3j646r3oll9km8jv3b.jpg
---

_I've had the privilege of using Uber's RIBs framework and corresponding coding pattern from the very beginning as a member of Uber's engineering team in Amsterdam. There was one thing that made it possible to adopt the protocol-based approach and easily write unit tests in a RIBs-based application: a code-generation tool that picked up protocol definitions from the sources of the program and generated mock classes for the protocols. Uber open-sourced [RIBs framework](https://github.com/uber/RIBs) in 2017 but did not include the code-generation tools along with it. I saw huge benefits of adopting RIBs architectural patterns in several projects I was involved in, but without a powerful mocking tool, the adoption would be problematic. In this article, I'm introducing the code-generation template that is powerful enough to cover typical use cases found in a complex application that fully adopts RIBs architecture and provides a few useful shortcuts for RxSwift types._


# Introducing [swift-sourcery-templates (Beta)](https://github.com/ivanmisuno/swift-sourcery-templates)

[swift-sourcery-templates](https://github.com/ivanmisuno/swift-sourcery-templates) repository contains two code-generation templates (to be used along with [Sourcery](https://github.com/krzysztofzablocki/Sourcery) engine):
1. `Mocks.swifttemplate` — to generate advanced protocol mock classes that can be used as [test doubles](https://martinfowler.com/bliki/TestDouble.html) in place of object dependencies for unit-testing;
2. `TypeErase.swifttemplate` — to generate advanced [type erasures](https://www.bignerdranch.com/blog/breaking-down-type-erasures-in-swift/).

Both templates support protocols with associated types and generic functions (with constraints on generic types),
provide reasonable default values for primitive types, and support advanced types and use cases typically found in projects
that use [RxSwift](https://github.com/ReactiveX/RxSwift), and, in particular, User's [RIBs](https://github.com/uber/RIBs) frameworks.


# Sample Project

Along with the templates' documentation, I'm planning on publishing the tutorial article. Meanwhile, I'm developing an [accompanying project](https://github.com/ivanmisuno/Tutorial_RIBs_CodeGeneration), please feel free to check it out and give code-generation templates a try.

Would appreciate any feedback!

Thanks.
#codevember - 5 - Music
Tags: codevember, showdev
Published: 2018-11-05 22:21:30

---
title: #codevember - 5 - Music
published: true
tags: codevember, showdev
canonical_url: https://nikol.as/blog/2018/11/codevember-5-music/
---

{% codepen https://codepen.io/vintagesucks/pen/LXVRjY %}
Awesome Ruby Security Resources
Tags: ruby, rails, security, devhelp
Published: 2018-11-05 22:09:38

---
title: Awesome Ruby Security Resources
published: true
description: A curated list of awesome Ruby Security related resources.
tags: ruby, rails, security, devhelp
cover_image: https://thepracticaldev.s3.amazonaws.com/i/p6ml6iz3i99vzs25vyhp.png
---

A New, Curated List of Ruby-related Security Resources:

https://github.com/pxlpnk/awesome-ruby-security

I just started out collecting them in one place, so it is far from complete or perfect. Everyone is invited to help out and submit more useful links so we all can build secure apps.

Also, make sure to check out the node.js list we have been working already: https://github.com/lirantal/awesome-nodejs-security
Test Driven Development in 1000 characters
Tags: tdd, tests, craftsmanship
Published: 2018-11-05 21:32:51

---
title: Test Driven Development in 1000 characters
published: true
description: An introduction to TDD in 1000 characters
tags: TDD, tests, craftsmanship
---
Test Driven Development (TDD) is a practice of Extreme Programming consisting in writing tests before production code to guarantee the code quality.

Development process is divided in 3 steps:
- Red: write a failing test
- Green: write the minimum production code required to make the test pass, all shortcuts are allowed
- Refactor: clean the mess of the code you just wrote to make it clean, improve the design

Since no production code is added before a test covers a usecase, test coverage is as close as possible to 100%.

Moreover, TDD promotes the usage of clean code principles thanks to the refactoring stage.

It can also help to make a clean design appear progressively. As Uncle Bob says: "as the tests become more specific, the code becomes more generic".

TDD helps team to write code that is easier to maintain and less risky to deliver.

TDD is often difficult to learn, especially on real life projects. Code katas are helpful to master this practice progressively with more simple use cases.
Talking about craftsmanship in 1000 characters
Tags: craftsmanship, shortarticles
Published: 2018-11-05 21:32:12

---
title: Talking about craftsmanship in 1000 characters
published: true
description: 
tags: craftsmanship, short articles
---
Time is precious, this is a resource we would all be glad if we could have more. Although long detailed articles are great to learn a lot about a subject, I think some very small posts to present a topic briefly can be a good kickstarter.
So, I’d like to try a format of very short articles, to give an overview of a subject related to software craftsmanship in only 1000 characters. This may be a difficult constraint, but summarizing complex topics in this very small format will also help me to only talk about the core principles, the ones that should be remembered even if readers don’t go deeper with other posts.
And I also hope that it will help me write more on dev.to ;-)
My first article in this « Less than 1000 characters » series will be about [Test Driven Development](https://dev.to/schreiber_chris/test-driven-development-in-1000-characters-13gd). Don’t hesitate to propose some topics you would like to read about !
We launched a new version of Hackmetrix! Still free, just better.
Tags: security, webdev, whitehathacking, pentesting
Published: 2018-11-05 20:56:52

---
title: We launched a new version of Hackmetrix! Still free, just better.
published: true
description: 
tags: security, web development, white hat hacking, pentesting
---

<a href="https://hackmetrix.com" rel="canonical"><img src="https://thepracticaldev.s3.amazonaws.com/i/dydrdaqiuxyq4nbdf2s0.png"/></a>

Hey everyone! Nando, writing for the Hackmetrix team here.

We just released the new version of Hackmetrix with a totally renewed design and several new features including API access, recurring scans, an integration with slack, and scanning web apps as a logged in user.

For those of you who've never heard of us before, Hackmetrix lets you scan your web apps to discover security flaws and then gives you super clear dev-friendly tips on how to fix them.

We'd love to hear your thoughts on our work, so please feel free to try it out and drop me a line on <a href="https://twitter.com/dsayunando">Twitter</a>

You can make a free account (no shenanigans and no CC required) at <a href="https://www.hackmetrix.com/?utm_source=devto&utm_medium=link&utm_campaign=launch">this link</a>

Thanks!
To test or not to test, is that even a question?
Tags: testing, discuss, beginners
Published: 2018-11-05 20:40:46

Frankly, it blows my mind that this is even a discussion. I am not sure how much I can really write one this topic, because my views really boil down to this...

Why the fuck are you not testing your code?

Do you like learning you broke prod?

Do you enjoy being afraid to tackle a bug because your not sure how that class really even works?

Do you like having to train any newbie for months before the feel comfortable committing?

Do you need to do TDD? BDD? MKBHD? No, I don't give a damn, but if you code professionally and don't write tests of any kind you are doing yourself and your team a dis-service so severe it could destroy the project in the long run. 

If your boss is the reason you don't test quit, seriously quit that job because you will end up hating it in a few months anyway. 

Lets talk facts, TDD reduces bugs that make it to Production by[40% to 80%](https://www.computer.org/csdl/magazine/so/2007/03/s3024/13rRUygT7kK)
Which according to all that stats I can find on the topic makes it _almost comically more effective than types_ which is the common thread I see among "non testers". They work in typed languages.

The problem with this is that they are working in what I call "Liar Typed Languages" the compiler makes you feel warm and cozy, meanwhile its not checking *shit*. Sure its making sure you are passing in a Number and not a String, thanks every year I make that mistake a few times... You really saved me types... You know what type of bugs I suffer from daily? undefined or null. What does Java's or C#'s type system do to protect me from those? Jack shit. At least languages like Haskell or Elm have effective type systems that genuinely protect you from this. 

So those are my thoughts on that, test your code and don't let lying types be your safety net. See you tomorrow!
Duplicating Line(s) in Chrome DevTools Editor
Tags: devtips, chrome, devtools, webdev
Published: 2018-11-05 20:28:08

---
title: Duplicating Line(s) in Chrome DevTools Editor
published: true
description: How to duplicate (copy) one or more lines in Chrome DevTools Editor using drag and drop
tags: devtips, chrome, devtools, webdev
---
![](https://thepracticaldev.s3.amazonaws.com/i/0tectm0h9lyhril2uxp7.jpg)
Here is a useful tip for those who want to quickly copy a single line or a number of adjacent lines while editing code in **Chrome DevTools Editor**. Prior to **version 62**, **Chrome DevTools** on **Windows** used to have this nifty feature to quickly duplicate a single line by pressing **Ctrl+C** followed by **Ctrl+V** on that line without selecting any text. Later versions of Chrome DevTools, for some reason, discontinued this extremely useful feature. Even the usual Windows method of drag and drop while pressing Ctrl key does not produce a copy of the selection in Chrome DevTools - but rather moves the selection. I have created a [ticket in the Chromium project bugs tracker](https://bugs.chromium.org/p/chromium/issues/detail?id=800028#c1) to reinstate this feature - but nothing has been done yet.

But recently I discovered a method to make the drag and drop copying to work: after selecting the text that you want to copy, if you **press Ctrl key and start dragging the selection and then press Shift key while dropping the selection at the destination, it creates a copy of the selection at the destination**. I noticed that the sequence of operation matters:

**1. Press Ctrl key before you start dragging the selection**

**2. Press Shift key while dropping the selection at the destination**

The version I have tested it is **Chrome 70**. YMMV. Hope it helps to some extent those who are still grieving - like me - the missing line duplication feature in Chrome DevTools editor on Windows.
A short list of Data Science resources
Tags: python, datascience
Published: 2018-11-05 20:03:50

---
title: A short list of Data Science resources
published: true
description: 
tags: #python #datascience
---
In the last months I have been reading a ton of articles here, even if I am not a "full" developer. Indeed I am a data scientist.
Now, since I would like to contribute in a more active way,  I think that a nice way to start may be a post with some resources that used lately, during my data science activity.

Without further ado, here it's the list:
- If you are in the business of object detection but your pictures are not already labeled try LabelImg https://github.com/tzutalin/labelImg
- https://www.any-api.com provides documentation and test consoles for over 500 public APIs. Just to name a few: NBA,Spotify, Gmail.
- Tabular data are not always found in csv files. Sometimes you need to extract them from a pdf: check out camelot https://github.com/socialcopsdev/camelot
- Nice blog post to use pandas at its best
https://realpython.com/fast-flexible-pandas/

I hope that this links can be useful for someone else.
I gladly appreciate any feedback.
Code Newbies - Lets Connect
Tags: beginners, webdev, javascript
Published: 2018-11-05 19:32:36

---
title: Code Newbies - Lets Connect
published: true
description: 
tags: beginners, webdev, javascript 
---

Hey guys 👋,

Have been in this community for a few weeks now and it is 😎. Everyone seems so friendly and the content is amazing too. So much to learn!

I’m just wondering how many newbies / learners there are on here. It would be great to connect and grow together. Come say 👋.
How much miscommunication comes from assumptions?
Tags: discuss
Published: 2018-11-05 19:00:53

---
title: How much miscommunication comes from assumptions?
published: true
description: Miscommunication stemming from assumptions
tags: discuss
---

Have you been in the scenario where you and your coworkers are busy implementing a project and in the middle it is exposed that everyone's assumptions around the topic are not the same? How did you deal with that?
What tense do you use in Git Commit messages?
Tags: git, discuss
Published: 2018-11-05 17:37:59

---
title: What tense do you use in Git Commit messages? 
published: true
description: Do you use past or imperative tense commit messages?
tags: git, discuss
---

Let's pick each other's brains for a sec.

Do you use past or imperative tense in your commit messages?

## Past
> added button to page

## Imperative
> add button to page

---

# Discuss

Why? Pros vs. cons?  Have you tried one and moved to the other?  Which one makes better sense?
MageAnts Magento 2 Pre Order Extension
Tags: magento2preorder, extension
Published: 2018-11-05 14:11:13

---
title: MageAnts Magento 2 Pre Order Extension
published: true
description: Give your customers a continuous shopping experience by allowing them to get the product they are willing to buy even if it is out of stock or not released yet using Magento 2 pre-order extension.
tags: Magento 2 Pre Order, Extension
---

The phrase 'out of stock' is a loss for both a customer as well as a store owner because the customer won't get the desired product and the owner will lose a potential buyer due to the unavailability of the product. Well, not anymore, [Magento 2 Pre Order](https://www.mageants.com/pre-order-extension-for-magento-2.html) Extension allows customers to pre-order or backorder their favourite product, either out of stock or upcoming, in advance.

**Key Features**

**Order out of stock and even upcoming products**
When a particular product is out of stock, customers look out for other options. But this extension will allow them to buy products that are temporarily out of stock or coming soon.

The admin can set which out of stock products to be made available for pre-order as well as restrict the mixing of regular and pre-order products in the cart.

**Customizable buttons**
Pre-order in Magento 2 allows the admin to configure the Add to Cart button into Pre-Order button on both category and product pages.

Store owners can also customize the notes or texts of pre-order products, informing the customers why that particular product is a pre-order item. Even a warning message can be set in shopping cart and order information page that will let the customers know that the product is temporarily unavailable but their product has the pre-order option which they can benefit from.

It also displays the product availability date and sends alert to the customers about their pre-order products.

**Order information page**
Magento 2 pre-order module shows the complete list of pre-ordered items on the store altogether which makes it easy for the admin to keep a track of it.

The admin can also configure the current order status of pre-ordered items to keep the customer informed.

**Allows to pre-order configurable, grouped and bundle products**
Magento 2 pre-order enables its customers to pre-order configurable, grouped and even bundled products. But only out of stock configuration will be marked as pre-order; rest of the product combinations are eligible to be sold normally.

If in any case, one of the items in a bundle or a group is currently available only for pre-order, the customer will get the corresponding notification.

Content Source by MageAnts https://www.mageants.com/pre-order-extension-for-magento-2.html
Why do you change the host? Custom host in local development
Tags: discuss, elm, server, host
Published: 2018-11-05 16:39:28

---
title: Why do you change the host? Custom host in local development
published: true
description: Looking into use cases for changing the host during local development.
tags: discuss, elm, server, host
---

I am looking to improve docs for https://github.com/wking-io/elm-live and had a question about hosts. What are use cases where you change the host for your local development server from `localhost`? Would love to pull data from other developers outside of my personal experience!

From other discussions I have heard the following:

- Testing `https://`
- Testing subdomains
- Just like setting up pretty domains for local dev
PostgreSQL: Efficient Queries - Indexing
Tags: postgres, sql, tutorial
Published: 2018-11-05 14:15:48

---
title: PostgreSQL: Efficient Queries - Indexing
published: true
description: How to index your tables to make your queries perform far more efficiently.
tags: PostgreSQL, SQL, Tutorial
---

[PostgreSQL: Efficient Queries - Indexing](https://www.smoothterminal.com/articles/efficient-queries-indexing)

For those who have been following this series, you will know that we have seen some in depth ways we can analyze and understand what is going on within our queries. Now we're going to focus on a few things we can do to make them a little more efficient. Let's get started.
Module Monday 19: Fullpage transition, Photoswipe, Animated counters & more
Tags: showdev, opensource, webdev, javascript
Published: 2018-11-05 15:28:37

---
title: Module Monday 19: Fullpage transition, Photoswipe, Animated counters & more
published: true
description: Module Monday 19
tags: showdev, opensource, webdev, javascript
cover_image: https://res.cloudinary.com/component/image/upload/c_fill,h_350,w_880/v1541192575/fullpage_50_mceul4.gif
canonical_url: https://guide.anymod.com/module-monday/19.html
---

## Add these features anywhere

Everything below is open source and free to use on any website, web app, or anywhere else. [Anymod](https://anymod.com) has hundreds more like these.

Click a mod to see it along with its source code.

## Full-page scroll
Create a full-page scrolling set of slides with any content you want.

<a class="btn btn-sm" href="https://anymod.com/mod/rblkl?v=20">View mod</a>

<a href="https://anymod.com/mod/rblkl?v=20">
  <img src="https://res.cloudinary.com/component/image/upload/v1541192575/fullpage_50_mceul4.gif"/>
</a>

## Swipe gallery
Click a thumbnail to view a larger image. Click again to zoom even more.

<a class="btn btn-sm" href="https://anymod.com/mod/dmnob?v=20">View mod</a>

<a href="https://anymod.com/mod/dmnob?v=20">
  <img src="https://res.cloudinary.com/component/image/upload/v1541199655/gallery_50_ivpwzw.gif"/>
</a>

## Team member profiles
Showcase your team in the best of lights.

<a class="btn btn-sm" href="https://anymod.com/mod/korbd?v=20">View mod</a>

<a href="https://anymod.com/mod/korbd?v=20">
  <img src="https://res.cloudinary.com/component/image/upload/v1541297827/team_iaixvq.png"/>
</a>

## Animated counters
Build the suspense. How high can it go?

<a class="btn btn-sm" href="https://anymod.com/mod/mkrmk?v=20">View mod</a>

<a href="https://anymod.com/mod/mkrmk?v=20">
  <img src="https://res.cloudinary.com/component/image/upload/v1541295110/counters_xtyltt.gif"/>
</a>

## Facebook comment section
Add a comment section to any page.

<a class="btn btn-sm" href="https://anymod.com/mod/orlam?v=32">View mod</a>

<a href="https://anymod.com/mod/orlam?v=32">
  <img src="https://res.cloudinary.com/component/image/upload/v1495057381/dwj8po1whgkw40cxplie.png"/>
</a>

<hr>

I post new mods [here](https://dev.to/tyrw) every (Module) Monday -- I hope you find them useful!

Happy coding ✌️
Part One: Learn Ruby With Me - What is Ruby?
Tags: explainlikeimfive, webdev, ruby, beginners
Published: 2018-11-05 14:45:23

---
title: Part One: Learn Ruby With Me - What is Ruby?
published: true
description: 
tags: #explainlikeimfive #webdev #ruby #beginners
cover_image: http://i67.tinypic.com/2z6a32h.jpg 
---

I recently just finished my Nanodegree from Udacity, but I wanted to keep busy so I am learning Ruby. I am not sure if I want to go all in on Ruby or just want some exposure to it. 

They say you learn the best, when you teach what you've learn. Every week, I will "teach" through blog posts to not only help someone else, but also reiterate what I'm learning. 

---

I want to teach not only the syntax, but also show the application. One thing I struggled with when learning programming languages,  is learning the syntax but not having any clue how to apply this when developing. 

Coming from a JavaScript background, I may use JavaScript references to help me also better understand explaining Ruby. 



# First Things First: 

### 1. What is Ruby?

- According to the Ruby website, it's a:  dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write

  *In others words:* You can use Ruby like any other general-purpose scripting language

### 2. What can I build with Ruby?

- Web applications, web servers, system utilities, database work, backups, parsing, even biology and medicine.
 

### 3. You may say: "I hear Ruby and Ruby on Rails all the time, what is it? Are they same?

- Ruby is the Programming Language
- Ruby on Rails is a web-application framework that is implemented in Ruby.

*In other words:* It's what React is to Javascript. React is the framework while Javascript is the programming language. 


### 4. Who uses Ruby?

- AirBnb 
- Dev.to