teleren/devto huggingface dataset:
Pirrigator, part 4.
Tags: rust, raspberrypi, sideprojects
Published: 2019-04-12 21:35:37

---
title: Pirrigator, part 4.
published: true
description: Mostly electronics so far
tags: #rust #raspberrypi #sideprojects
series: Watering tomatoes with a Raspberry Pi 
---

Apologies, I haven't posted an update here for a while for a few reasons. The weather is getting better and I've been more inclined to get outdoors and enjoy it. I'd recommend the same to anyone, no matter how much you love your coding time. Also I've mainly been working on the electronic parts of my project, making it up as I go, and working through the Rust book on the side.

The circuit is almost complete. At first I was going to bring wires out to screw terminals on the exterior of the box but that seemed clunky and fragile so I've ordered a bunch of 2.5mm DC jacks which I'll mount around the box, and connect everything up with cables that plug in. Should be much more robust, although using the same connector for everything from 12V supply to the moisture sensors is not ideal. I'll just have to make sure I label them.

![Circuit board image](https://thepracticaldev.s3.amazonaws.com/i/f6rj4uqvi7yitg6pysgt.jpg)

On the board are the weather sensor, three moisture sensors with the analog outputs fed into an MCP3008 ADC chip, and three TIP120 darlington transistors controlled by GPIO lines, for the water valves. I've added LED indicators to show when the valves are (meant to be) open. On the top of the box is a push button wired directly to a GPIO line and ground - I'll add a feature in software to open and close the water valves directly when the button is pushed. Manual overrides are handy.

I'm really enjoying learning Rust. It feels familiar like C but with the added advantages of a strong type system and modern programming features. The ability to write chains of iterator adaptors, functional style, and have it compile to much the same machine instructions as the imperative loop is really impressive. I look forward to using this more.

The controller software structure is getting clearer in my head - essentially an event bus onto which various modules can publish or subscribe to events. Then I'll write separate modules for all the various bits of hardware and software features, and use an external config file to determine which modules are instantiated. Seems like that'll be enough to force me to write something resembling real-world code, at the same time it will also be maintainable for behaviour tweaks as the summer passes. At the weekend I'm hoping to get started with multithreaded Rust code so I can start putting together the basic structure of the application.
GatsbyJ Starter - Html5Up Dimension
Tags: gatsby, htmls5up, appseed
Published: 2019-04-12 21:16:12

---
title: GatsbyJ Starter - Html5Up Dimension
published: true
description: GatsbyJS and HTML5_Up, something nice will comes up
tags: gatsbyjs, htmls5up, appseed 
---

The equation is simple:

**Gatsby.js** + Html5 Up Design + [My startup](https://appseed.us/apps/gatsbyjs) = [GatsbyJ Starter Html5Up Dimension](https://appseed.us/apps/gatsbyjs/html5up-dimension)


![GatsbyJ Starter - Html5Up Dimension Image](https://static.appseed.us/misc/thumb-gatsby-dimension.png)


I'm done because I know that you need time to code amazing stuff. 


Related resources:
- [Gatsby.js](https://www.gatsbyjs.org/) official website
- Index with [GatsbyJS Apps](https://appseed.us/apps/gatsbyjs) - mostly free apps

Cheers!
CSS3 Grid Layout Notes
Tags: css, grid, layout, ddesign
Published: 2019-04-12 21:00:08

Some notes I wrote in the process of making a short course on CSS3 grid layout 


![](https://thepracticaldev.s3.amazonaws.com/i/qznbo5a4tvadfp5w3nq9.JPG)

![](https://thepracticaldev.s3.amazonaws.com/i/ej1dmfy6axkbbr9xxom1.JPG)

![](https://thepracticaldev.s3.amazonaws.com/i/rmkxux1obmd3a5wsv1b7.JPG)

![](https://thepracticaldev.s3.amazonaws.com/i/n3ey20dnw8c7sxuk6qv5.JPG)

![](https://thepracticaldev.s3.amazonaws.com/i/qo92528d7go6zxmlg7vi.JPG)

![](https://thepracticaldev.s3.amazonaws.com/i/6lidrjbcj5if1nx7vtk9.JPG)
Has C++ aged badly?
Tags: discuss, healthydebate
Published: 2019-04-12 19:59:36

The last time I consistently programmed C++ was several years ago. 

A few days ago, a developer told me that over the years, new C++ versions have become more and more bloated. 

He also said that the primary argument for using C++, execution speed, doesn’t count any more, given languages like Rust are well designed and performant.

What do you think?
A Taste of Node Express
Tags: javascript, node, rest
Published: 2019-04-12 19:22:53

---
title: A Taste of Node Express
published: true
description: I help another student and find I might love Javascript?
tags: javascript, node, nodejs, rest
---

# A Taste of Node Express

I am helping a student debug #code in a #node framework I've never even heard of until today #programming #coding #dev #webdev #devcommunity 

After having [bruteforced](https://dev.to/therealdarkmage/platforms-python-practice-projects-and-picking-up-flask-a-blog-story--2mbl) my way through Python's Flask, I now have a pretty good gist of what it means to create a REST setup.

Basically, the tl;dr of it is that modern websites do things in the following way:

```
www.somesite.com/myrest/login
www.somesite.com/myrest/logout
www.somesite.com/myrest/getuserinfo
www.somesite.com/myrest/dostuff
www.somesite.com/myrest/post
www.somesite.com/myrest/etc
```

Note the very nice structuring here. This is done on purpose for organization. I was totally not used to this growing up. Nobody taught me REST. Nobody taught me how to do anything like this in webdev. I didn't even wanna do webdev originally...

This journey all began around age 11 or 12. Not long after my back surgery, our home got Internet via America Online 3.0. I began making websites shortly after. Before this, a family friend gave me my first machine: an MSDOS Tandy machine. I remember figuring out how to write a simple 4-function calculator in BASIC back then. My websites were written in simple HTML, but even then, I managed to get onto a Final Fantasy 7 webring (lol, the good old days).

Recently, I helped a student [find some bugs in a language thingy I barely know anything about](https://dev.to/therealdarkmage/finding-bugs-in-languages-frameworks-you-don-t-know-node-js-52no), but it turns out that if you know some basic things that you can cross-apply them to areas that you don't know.

This is, in general, how people pick up new things.

**node express** seems like something similar to Flask, but for node (duh). It is a REST-type system that allows you to construct endpoints in a similar manner. Like Flask, you can test it locally or run it on a server. This makes it super-easy to whip-up custom websites.

A lot of what I see from my student's code looks like this:

```
app.get('/home', function(req, res) {
	// code here
});

app.post('/login', function(req, res) {
	// code here	
});
```

It is pretty cool. Javascript is easy (which is why I've never used it lol), but as I am growing up, I am finding that you can do some really cool stuff with it super-easily. 

I've always preferred working from a lower-level or backend perspective, but everyone's always trying to pick me up for iOS or webdev frontend roles (ugh!), and for a long time, **node.js** just seemed too hipster (like Ruby) for me to care about.

After this student, I'm gonna have a sit-down with **node.js**. In a world of Angulars and Reacts and vues, I'm thinking I'm a node :D 

-----

# [If you need a Computer Science tutor, code reviewer, or just someone to pair program with, hit me up](https://codementor.io/mikebell66)
Real World Developer's Problems: API Versioning
Tags: api, discuss, webdev
Published: 2019-04-12 19:13:23

---
title: Real World Developer's Problems: API Versioning
published: true
description: In some moment you API would be evolving, and you need to support the features they provide.
tags: api, discuss, webdev
series: Real World Developer's Problems
cover_image: https://thepracticaldev.s3.amazonaws.com/i/k7yfldnbldart38mws92.jpg
---

The backend world is fascinating and full of new things to discover.
In the beginning, you can feel domed with all the information, so the best way to understand is used commons examples that apply these concepts.

When you're designing your backend, it is essential to have on mind some considerations. Think that your contract on the future would change and you need to maintain backward compatibility.

In some moment you API would be evolving, and you need to support the features they provide. Managing the impact of this can be quite a challenge when it threatens to break existing client integrations.

REST doesn’t specify any method of versioning, but the more common approaches are: 

* Specify the version putting it on the URI:
`https://api.example.com/v1/`

* Using a custom request header:
`Accept-version: v1`

* Alternatively, adding to the HTTP Accept header
`Accept: application/json; version=1`

With these approaches, your challenge would be managing the entire code base with multiple versions of your resources. Content negotiation may let you prevent modify your entire collection of URLs, but you still have to deal with the all complexity of serving different versions of content.

Another approach can be to develop a consumer-driven contract that allows to consumer declare the data they are interested in consuming as part of a request. On this last case, you're delegating the responsibility to the client.

Whatever approach you take, need to be consistent and active governance over the evolving contract.

Comment here what another approach you recommend or know it to recommend us.
Taking time out from freelancing
Tags: career
Published: 2019-04-12 18:59:37

---
title: Taking time out from freelancing
published: true
description: After 10 years, I am taking a break from freelancing, this is why
tags: career
---

6 weeks ago I took the step to look for a full time job, I have been freelancing for 10 years but needed a break from it, this post is my reasons why and how I feel i am fitting in.

## About me
I am a WordPress developer in the uk, been freelancing for 10 years with hundreds of amazing projects completed.

## My reasons
There are too many to list but my top 3 are:

- Time - When you freelance your mind is always on work, it's hard to switch off and relax, you're either thinking about deadlines or chasing invoices, after 10 years I need a break to take some time out to not worry about work. You can't take time out for a holiday without a lot of planning and even then it will likely involve work.

- Money - Unless you have side business where recurring income happens, you're forever chasing the next pay cheque, always thinking about what work you have coming in to keep the pot of money full, when it gets low you have to work twice as hard to refill it.

- Learning - I felt I didn't have enough time in the day to handle all the work I had (fortunately was very busy) and to keep learning, I felt I was so far behind in where I wanted to be as a developer as I was concentrating on getting jobs completed and not improving myself.

## The job
I have taken a role as a front end developer which is WordPress focused, I am mainly building WP themes and plugins (which is what I enjoy). I work a standard 9-5 so I have time to myself at weekends and in the evenings, I have a constant pay cheque at the end of the month and only one week in I have already started using SASS, it had been on my todo list for over 2 years.

## The future
I am taking time out to enjoy life, I will finally have time to go to Wordcamps and other conferences, I can finally take a holiday next year without worrying about work, I will be able to save money a lot quicker to plan for the future.

I haven't stopped all freelancing, I am still doing bits here and there but they are projects I really want to do and on my terms. Will i go back full time freelancing? I don't know, I am taking each day as it
I switched careers to Software Engineering in my late 30s while nursing a newborn, Ask Me Anything!
Tags: ama, beginners, career, rails
Published: 2019-04-12 18:30:39

---
title: I switched careers to Software Engineering in my late 30s while nursing a newborn, Ask Me Anything!
published: true
cover_image: https://thepracticaldev.s3.amazonaws.com/i/inhic0j56h8utwv3tcaj.jpg
tags: ama, beginners, career, rails
---

After freelancing part-time as a Wordpress implementer (cos I never got into the PHP code), I decided to learn to code and switch careers from Public Health to Software Engineering. I enrolled in 6-month-long, 35hours/week online bootcamp when my daughter was just 4 months old. Six months after bootcamp, I landed my first full-time role.

I'm here to advise, support and cheer on anyone with a non-traditional background, or non-typical profile, who dreams of being a professional programmer. Ask away!
Using Lighthouse, Puppeteer, and Jest for Web Performance Testing
Published: 2019-10-30 00:19:56

---
title: Using Lighthouse, Puppeteer, and Jest for Web Performance Testing
published: true
date: 2019-04-12 18:22:35 UTC
tags: 
canonical_url: https://justinribeiro.com/chronicle/2019/04/12/using-lighthouse-puppeteer-and-jest-for-web-performance-testing/
---

Over the last several months, I’ve had a number of opportunities to help improve web performance testing for some companies. A lot of that work has been to integrate [lighthouse](https://github.com/GoogleChrome/lighthouse) with [jest](https://jestjs.io/), which I find has grown in popularity as folks move to more modern tools in their respective teams.

This isn’t the first time I’ve gone down this road with integrating lighthouse. My [previous example with mocha](https://github.com/justinribeiro/lighthouse-mocha-example) remains quite popular as a start point (though could use it’s own update). But I did want to do something a little different inregards to throttling, so I decided to use [puppeteer](https://github.com/GoogleChrome/puppeteer) to handle the network conditions and [WebPageTest connections profile examples](https://github.com/WPO-Foundation/webpagetest/blob/master/www/settings/connectivity.ini.sample) as the baseline.

The end result: [lighthouse-jest-example](https://github.com/justinribeiro/lighthouse-jest-example), a basic project that shows off how to use these tools together to test your web app. The sample under the hood does a few things:

1. It’ll start a local web server with HTTPS (which you can add to your cert chain via `certutil`) to run your site against. Or, you can just turn that off and test against a remote endpoint should you so please.
2. You can define urls per test, as opposed to a single entry point if you want to test variations of an approach.
3. You can further define mutliple connection types if you’d like.

This in turn looks not unlike any other jest testing you may run as in the screenshot below:

![testing with lighthouse in jest](https://storage.googleapis.com/jdr-public-imgs/blog/20190412-lighthouse-jest-testing-cli.jpg)

The [repo](https://github.com/justinribeiro/lighthouse-jest-example) has all the details. Have questions or fix? File a ticket and pull requests always welcome.
Sketch Data Table Components
Tags: sketch, design, ui
Published: 2019-04-12 17:23:11

---
title: Sketch Data Table Components
published: true
description: I created my own dynamic Sketch table and decided to share it with everyone (because tables are hard enough right? 😅😵) 
tags: sketch, design, ui
cover_image: https://thepracticaldev.s3.amazonaws.com/i/udmnozn313axn4r9hfax.jpg
canonical_url: http://whoisryosuke.com/blog/2019/sketch-table-components/
---

Tables - they comprise a multitude of different interfaces we consume on a regular basis. Spreadsheets, CRMs, settings pages -- we see tables everywhere in our UI and it's inevitable as a designer that you'll have to mock one up (without completely copping out with a screenshot of Excel/HTML).

I had to design a table for a client in Sketch, so I did a quick search for dynamic Sketch table symbols/components, and I couldn't track anything down that was _actually_ dynamic. Most tables were "hard coded" in a sense, with their columns and rows defined by line shapes, instead of individual cells, making it impossible to change the table format beyond the template.

So I set off and created my own dynamic Sketch table and decided to share it with everyone (because tables are hard enough right? 😅😵)

![Example Table](http://whoisryosuke.com/static/example-table-33fed95da8d740d0eddbe4a1b4049d88-0265e.jpg)

## How to use 🛠

[**Download the Sketch template here**](https://github.com/whoisryosuke/ryosuke-gatsby-blog/tree/master/src/content/blog/2019/sketch-table-components/Dynamic-Sketch-Tables.zip)

1.  Insert desired cell symbols and align horizontally into a table row.
2.  Group the table row (to make it easier to work with).
3.  Copy and paste the row, then align underneath. Repeat until desired row count is reached.
4.  CMD/CTRL + Click each cell and change the data dynamically in the sidebar (like text or even icons!)
5.  Resize to your ❤️'s desire 👌

![Example Subtitle Table](http://whoisryosuke.com/static/example-table-subtitles-492a8ec9b43ee9bfb54cf54aec26c048-0265e.jpg)

## The limitations / caveats 🚦

### Complex text styles 🖍

If you'd like a cell where a portion of the text is bold or colored differently than the defined text style, you'll have to detach it from the symbol. Sketch simply can't handle nested text styles yet in that capacity.

![Example Multiline alternating row Table](http://whoisryosuke.com/static/example-table-multilines-eaf72eee5240e14f233ab00cba00e913-0265e.jpg)

### Alternating table rows⚪️⚫️

You could add a nested symbol for alternating table rows, but it becomes cumbersome to delete a row, and have to go into each cell/row and swap the background style. I've found it's easier to separate the alternating background behind the table row group, and you can delete rows and move them up without fussing with backgrounds.

## Table tennis for days 🏓

I hope this helps you design some tables in the future and expedite the already painful process of data-based design. If you have any questions feel free to hit me up on Twitter or comment here. And let me know if you 👀 any glitches 👾

Cheers,
Ryo
URL Routing for Simple Websites
Tags: help, discuss
Published: 2019-04-12 17:10:17

---
title: URL Routing for Simple Websites
published: true
tags: help, discuss
---

For a simple website (not Vue, React, non-framework), can you set up a routing system for url's or is it better to store url's within a simple list or array?

Currently I use htaccess file to rewrite urls to remove trailing slashes and file extensions. Is there a better way other than htaccess? FYI, I'm working in php mostly out because of familiarity and includes, but not a MVC setup. A very simple website that's not pulling from a database. Any recommendations are welcome.
EasyBot, the JSON Discord Bot
Tags: discord, javascript, node, json
Published: 2019-04-12 17:09:33

---
title: EasyBot, the JSON Discord Bot
published: true
description: It's hard to create a Discord bot... No?
tags: discord, js, nodejs, JSON
---

Create a Discord Bot it's hard. You have to setup NodeJS, some modules, and write the same code again and again when you want to add some commands. It's for that I've create a project called EasyBot! Here you can create a Discord bot with just a JSON file on a web interface!

(The web interface is still work in progress and CSS is not my favorite part at all xD)

So if you want to try this code, you just need an environement wich can run NodeJS, clone the Github repo, install the modules and that's it!

{% github Bigaston/easy-bot %}

You can get more information in [the doc](https://easy-bot.js.org/)!
Let's Build a Web Scraper with Cypress!
Tags: cypress, webscraper
Published: 2019-04-12 17:06:07

---
title: Let's Build a Web Scraper with Cypress!
published: true
description: 
tags: cypress, webscraper
cover_image: https://thepracticaldev.s3.amazonaws.com/i/xo8vhcnbt0ibr8pc8kx6.jpg
---

[![Check out the Free Lesson on Egghead.io](https://thepracticaldev.s3.amazonaws.com/i/yk7ev8mmeuc62bzo6bek.png)](https://egghead.io/lessons/cypress-create-a-web-scraper-with-cypress)

What would you build if you had a web scraper?

* Maybe your fitness tracker has no public API?
* Or you want to always outprice your competitors?
* Maybe you want to correlate and visualize data from multiple, disconnected platforms?
* Want to automate common tasks on an external site?

Or maybe you're like me, and the website that lists all your open mic comedy events doesn't have any ability to search, filter, or show event locations on a map.

So how do we ingest this data for fun and profit?

## Cypress to the Rescue

[Cypress](https://www.cypress.io/) is a blazing-fast end-to-end testing framework. Since it can interact with any webpage, we can also use it to automate interactions with external sites!

Build it along with me in this free lesson on Egghead.io!

[![Check out the Free Lesson on Egghead.io](https://thepracticaldev.s3.amazonaws.com/i/yk7ev8mmeuc62bzo6bek.png)](https://egghead.io/lessons/cypress-create-a-web-scraper-with-cypress)
List of Podcasts talks about the programming languages
Tags: podcast
Published: 2019-04-12 16:31:40

---
title: List of Podcasts talks about the programming languages
published: true
description: My favorites podcasts and bookmarks
tags: podcast
---

Yes I love the following podcasts!

| Title | Programming Language | Link |
| :----- | :------------------------------:| :-----|
| clfreaks | Common Lisp            | https://clfreaks.org |
| CppCast | C++                           | https://cppcast.com |
| Java Pub Houst | Java                  |  https://www.javapubhouse.com |
| TalkPython | Python                    | https://talkpython.com |
| Reason Town | ReasonML         | https://reason.town |
| Swift Community Podcast | Swift | https://www.swiftcommunitypodcast.org |
| defn | clojure | https://soundcloud.com/defn-771544745 |
| Talking Kotlin | Kotlin | http://talkingkotlin.com |
| ElixirTalk | Elixir | http://elixirtalk.com |
| PHP Podcasts | PHP | https://www.phppodcasts.com |
| .NET Rocks! | .NET | https://dotnetrocks.com |
| .NET Core Podcast | .NET Core | https://dotnetcore.show |
| JS Party | JavaScript | https://changelog.com/jsparty |
| JavaScript Air | JavaScript         | https://javascriptair.com |
| NEW RUSTACIAN | Rust | https://newrustacean.com |