teleren/devto huggingface dataset:
Episode 2 of #DebuggingDowntime is live-streaming tomorrow!
Tags: devops, rails, debugging
Published: 2019-01-29 01:46:37

---
title: Episode 2 of #DebuggingDowntime is live-streaming tomorrow!
published: true
description: Betsy, Jackson, and I are once again plumbing the depths of Notabli to fix their recurring downtime issue.
tags: devops, aws, rails, debugging
---

Hey everybody!

Two weeks ago, we live-streamed a mob-programming session where we attempted to debug and resolve a recurring downtime problem for Notabli. Unfortunately, it didn't completely work, so we're heading back into the trenches tomorrow at 10 AM PT / 1 PM ET. You can [join us for the live-session tomorrow](https://public.aerialspac.es/Pair%20Programming%20Live%20Streams?eventId=c47576bb-cb1e-41b9-b582-bcb95a50e69c), or you can wait until we publish the uncut version to our [RealWorldCode YouTube channel](https://www.youtube.com/channel/UCGxJ6esUxAGYyu5Eok65Qgw). 

While all live-streamed, un-cut and rough-cut sessions will be available free to stream, we want to be able to afford to hire a professional video editor to tighten everything up and help us highlight the diamond in the rough.

To finance that, we are selling a [Debugging Downtime season pass](https://gum.co/rwc-s1-debugging-downtime). This gives you the rights to download the uncut, rough cut, and gold cut content, as well as funds our hiring of a rough cut of each of the sessions and if we can make enough to justify it, a tight cut that highlights the diamonds in the rough.
Episode 13: Building a JSON API - Quickly Adding HTTPS
Tags: node, docker, dockercompose, https
Published: 2019-01-29 01:41:42

---
title: Episode 13: Building a JSON API - Quickly Adding HTTPS
published: true
description: Episode 13 covers adding https to our api service through docker-compose
tags: nodejs, docker, docker-compose, https
series: building-a-json-api-with-express
cover_image: https://thepracticaldev.s3.amazonaws.com/i/kk0iih4vk08bstsr499f.png
---

In this episode, we cover adding `HTTPS` using `nginx` with `docker-compose` to our api.

{% youtube lQJlQ7Jmkmc %} 


Thanks for watching! 


Source code:

{% github NathanBland/core %}
Execute a child process that is not on the filesystem but in memory?
Tags: node, javascript, childprocess
Published: 2019-01-29 00:23:22

---
title: Execute a child process that is not on the filesystem but in memory?
published: true
description: Is it possible to execute a child process from memory?
tags: node, javascript, child process
---

I have been hanging on something for a while, maybe someone can explain it to me as if I'm five.

Is it possible to execute a child process from memory? For instance HTTP request an executable file foo.exe and exec/spawn it from buffer? I can't imagine it _has_ to be on the filesystem.

I tried npm installing browserfs but I get stuck on the same thing.
Sorting by Created Date with GraphQL and Prisma
Tags: prisma, graphql, database, tip
Published: 2019-01-30 04:37:09

---
title: Sorting by Created Date with GraphQL and Prisma
published: true
tags: prisma, graphql, database, tip
canonical_url: https://wheaton.dev/notes/prisma-system-fields
---

While working on a side project with Prisma and GraphQL, I ran into a common situation. I wanted to display a list of items sorted from newest to oldest.

My first idea was to add a field for the created date to the model, just like any other. This could be set in the mutation resolver when an item is created.

```
type Item {
  ...
  created: DateTime!
}
```

However, I was concerned that it could be accidentally updated in the future. Given how common this requirement is, I thought there might be a better solution.

Digging through the documentation, I learned of Prisma's [system fields](https://www.prisma.io/docs/reference/service-configuration/data-modelling-(sdl)-eiroozae8u#system-fields). These are read-only fields that are included in the underlying database, even when they aren't defined in the data model. They're a sort of hidden metadata for each node.

And yes, it's possible to expose these to the GraphQL API by adding a 'createdAt' field with a matching directive. Don't get creative here, the names must be exact.

```
type Item {
  ...
  createdAt: DateTime! @createdAt
}
```

It's now possible to query this like any other field. Prisma generates methods to filter and sort based on this field. For my needs, `createdAt_DESC` did the trick.

```
items(orderBy: createdAt_DESC) {
    id
    name
    description
    createdAt
}
```

That's all there is to it! And since this field had existed under the surface all along, it _already had data for all existing items_. This turned out to be a huge timesaver and is a feature I'll be using, along with the 'updatedAt' system field, regularly from now on.
Wrong Selection in R
Tags: r, beginners, learning
Published: 2019-01-28 23:40:03

---
title: Wrong Selection in R
published: true
description: 
tags: #R #Beginners #Learning
---
<img src="https://egmgem.com/blog/wp-content/uploads/2019/01/fig-1.jpg" alt="" data-id="2419" data-link="https://egmgem.com/blog/?attachment_id=2419" class="wp-image-2419" srcset="https://egmgem.com/blog/wp-content/uploads/2019/01/fig-1.jpg 768w, https://egmgem.com/blog/wp-content/uploads/2019/01/fig-1-300x144.jpg 300w, https://egmgem.com/blog/wp-content/uploads/2019/01/fig-1-624x300.jpg 624w" sizes="(max-width: 768px) 100vw, 768px" />

While reading the section on data frames in The Book of R, I got a result that was wrong from that in the exercise. Wrong because I had left out a comma in the code. Before I would just have corrected it and moved on, but this time around I wanted to know why it is I got that wrong result.

The data frame I was working with is

<img src="http://egmgem.com/blog/wp-content/uploads/2019/01/fig0.png" alt="mydata Data Frame" class="wp-image-2414"/>	

The code I typed was <code>mydata[mydata$sex=="F"]</code> This resulted in the following output:

<img src="http://egmgem.com/blog/wp-content/uploads/2019/01/fig1.png" alt="Unexpected Results" class="wp-image-2415"/>

Not quite what I expected. I then typed out just the test itself <code>mydata$sex=="F"</code> and got the following vector of logicals.

<img src="http://egmgem.com/blog/wp-content/uploads/2019/01/fig2.png" alt="Logicals vector" class="wp-image-2416" srcset="https://egmgem.com/blog/wp-content/uploads/2019/01/fig2.png 357w, https://egmgem.com/blog/wp-content/uploads/2019/01/fig2-300x43.png 300w" sizes="(max-width: 357px) 100vw, 357px" />

Looking at it, and comparing it to the output I got, things started making sense. The two columns I got back from my original code coincided with the logical <code>TRUE</code> values in the vector from the second code. What I had done by leaving out the comma was make a selection of columns instead of a selection of rows meeting the test criteria.

With this knowledge, I typed out the proper code <code>mydata[mydata$sex=="F",]</code> to get

<img src="http://egmgem.com/blog/wp-content/uploads/2019/01/fig3.png" alt="Expected Results" class="wp-image-2417"/>

The result I expected. Forcing myself to slow down and actually understand why code gives the output it does is doing wonders for my learning progress. Had I not understood from earlier reading and exercises how row and column selection coupled with logical values actually works, this would have been a much more difficult issue to figure out. Onwards with learning R!

Resources:

The Book of R: https://nostarch.com/bookofr
How to Start a Conversation Without Saying a Word
Tags: career, beginners, tips
Published: 2019-01-28 23:17:45

---
title: How to Start a Conversation Without Saying a Word
published: true
description: Networking advice for introverts.
tags: career, beginners, tips
cover_image: https://thepracticaldev.s3.amazonaws.com/i/uwoxmp40jp5rknfdg83k.png
---

How many of you LOVE going to conferences, but hate the awkwardness of having to walk up and talk to people you don't know???

![](https://thepracticaldev.s3.amazonaws.com/i/5w0e19l8290w9s4qwy06.gif)

I am definitely in that boat! At my core, I am an introvert. The idea of having to go up to someone I don't know and introduce myself is terrifying. Once the conversation is going, I am usually fine. But that initial approach is the worst! Thankfully, over the years, I have found a way to avoid having to make the first move altogether. Whenever I go to a meetup, conference, or any dev related social event I always follow this advice 👇  

# Wear Your Conversation Starter

When you go to a networking event, such as a meetup or a conference, wear something that will cause someone to strike up a conversation with you! Given that the engineering dress code is usually informal, and consists a lot of hoodies and T-shirts, wearing a conversation starter is incredibly easy.

Examples:
* A T-shirt with any of the following:
    * Favorite sports team or sport in general
    * Favorite piece of software 
    * City you are from
    * State you are from
    * Your college
    * Your favorite movie, TV show, computer game, band etc. 
    * An organization you are a part of
* A hat with any of the above
* A laptop sticker or bag patch with any of the above

**The key is visibility.** You want someone to be able to spot your conversation starter easily. By showing off what you are interested in, those with the same or similar interests, will often come up to you and start the conversation for you! By doing this, you will get yourself off the hook for having to initiate most of the conversations. Personally, I find it much easier to talk to someone when they come up to me, rather than me having to go up to them.

### Look For Conversation Starters

On the flip side, when you are at a meetup or conference, have your eye out for others who might be wearing conversation starters! If you see someone wearing a T-shirt with your city flag or alma-mater or favorite sports team, walk up and start a conversation using that piece of commonality. Hey, I see you are wearing an XYZ shirt, is that where you went to school? Is that where you are from? etc. Having a little piece of commonality like that will make getting the conversation going a lot easier than starting with something like, "Oh the weather was nice today!"

By wearing your conversation starter, you can find common ground with a stranger without even saying a word and that is going to make networking and meeting people a whole lot easier! So grab your favorite T-shirt and get out there and make some new nerdy friends! 🤓
Day 001: Making a TODO list
Tags: ios, swift
Published: 2019-01-28 22:53:43

---
title: Day 001: Making a TODO list
published: true
description: My daily log of making a todo list. Most of this will be done on my lunch break. Very little will be done at home.
tags: ios, swift
---

I will be documenting all work that I've done on my todo list. Each day, I'll make a list of what I've accomplished and learned. The goal is to make something functional.

The todo list is a single page app that has a text field, button, and list of todos.

Here is a [GitHub Repo](https://github.com/maeganjwilson/todo_list) that will have all my work in it.

Here is a basic screenshot of what I'm going for:
![basic screenshot. App title="TODO app"](https://thepracticaldev.s3.amazonaws.com/i/gk2i9f4ugi6ou08pn85h.PNG)

Keeping it simple to make something functional while learning.

## Features
- Type in a todo and tap a button to add to a list
- List of todos is presented
- Tap on todo to complete it
- Slide to delete todo
- Keep the list of todos if the app is closed

My plan is to not do any feature outside of the list above. This will allow me to stay focused on the goal.

## Today's accomplishments

- Started a blog series to keep me accountable
- Started an iOS project titled TODO
- Created a storyboard in Xcode
    ![storyboard](https://thepracticaldev.s3.amazonaws.com/i/3o3cch63mfnqptilxn5f.png)

## What I learned today 
How to do make a table view take up the bottom portion of the screen no matter the device

I used auto layouts to make this possible.
To fill the width:
1. Open the constraint menu
2. Click on the left and right restraints and make them 0
    ![picture of constraints for left and right](https://thepracticaldev.s3.amazonaws.com/i/mgu2g91ygamscejku8h2.png)
3. Click on add restraints

To fill the bottom:
1. Open the contsraint menu
2. Click on the bottom restraints and make it 0
3. Click on add restraints
Frontend Metrics: CSS Specificity
Tags: css, metrics, frontend
Published: 2019-01-28 22:50:36

---
title: Frontend Metrics: CSS Specificity
published: true
description: What are CSS Specificity graphs and how are they helpful? 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/bipxwy3ljekxfuzncfd3.png
series: Frontend Metrics
tags: css, metrics, frontend
---

I've been working a lot on discovering and tracking useful Frontend metrics and I wanted to share some of the things I've learned. This will probably be an ad-hoc, at-random series on all things Frontend Metrics as I learn more about them!

# What the heck is CSS Specificity?

[Emma] put together an overview of what CSS specificity is and has done a much better job than I ever could!

{% link emmawedekind/css-specificity-1kca %}

For a quick recap, CSS specificity involves the "cascading" part of Cascading Style Sheets. The specificity of a CSS selector decides which style should be given to an element. Good specificity should keep you from needing many `!important`s.

It's a great thing to know about when writing CSS and it is an even better thing to track over time! For my day job, we've been working to gather some frontend metrics so we can see how our work is impacting the application. One thing we are tracking is what the CSS specificity looks like across the whole file in something called a specificity graph.

# What does a good specificity graph look like?

![A CSS specificity chart](https://thepracticaldev.s3.amazonaws.com/i/cw4sfz5gg38sr2ptjelv.png)

A good specificity graph has a few noticable attributes. Firstly, it's plotted with the specificity of the selector along the `y` axis and the position of the selector in the CSS file along the `x` axis. Ideally, your specificity should hockey stick - for most of the file, it should remain steady and any major specificity spikes should be confined towards the end.

# How do you graph your CSS specificity?

I've got the metrics I am working on set up in my companies [Metabase](https://metabase.com), but I build a small tool to see your specificity graph. The code isn't super hard to understand. Try it out, then check out the `getCSSStats.js` file. It uses [cssstats](https://npmjs.com/package/cssstats) under the hood to get the stats for a chunk of CSS.

{% glitch mud-leather app %}

By monitoring the changes in the graph as you make changes to your CSS, you can ensure you are on the right track. It's not a hard-and-fast rule - lots of times you need certain specificity - and it's easy to break when using `scss` or `less` imports. When used as a quick health check however, a good specificity graph can be very useful!

Read more about specificity graphs [here](https://csswizardry.com/2014/10/the-specificity-graph/)

Have a great week, devs! What kind of metrics do you track? What do you think about CSS specificity graphs?
Resume in JSON: jsonresume-theme-stackoverflow
Tags: discuss, opensource, webdev, showdev
Published: 2019-01-28 22:43:48

---
title: Resume in JSON: jsonresume-theme-stackoverflow
published: true
description: a few years ago I wrote a template in handlebars and CSS inspired to StackOverflow.
tags: #discuss #opensource #webdev #showdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/pwl0x7k698f0ibddtpfc.png
---

### Resume in JSON 🤓

A few years ago I discovered [jsonresume](http://jsonresume.org), a very promising project aimed to provide a json-schema to write a resume.

I immediately got excited and I wrote 2 templates for that: 👨🏼‍💻

- **jsonresume-stackoverflow-theme**: [code](https://github.com/phoinixi/jsonresume-theme-stackoverflow) and [demo](https://phoinixi.github.io/website/resume/stackoverflow) which I am proud of 🕺
- another one that I actually don't like anymore 😆

### My first handcrafted resume template 🌟

The **StackOverflow** template was my first resume written using web technologies and it has some popularity, I got contributions and features requests. I use it myself as my resume and a bunch of my friends use it too. However, the schema is not very flexible and the last iteration was done 5 years ago [json-resume-schema](https://github.com/jsonresume/resume-schema).

The current stack to write a template for **json-resume** is quite old too: **Handlebars.js**. 

### Need for a rewrite 😎

My idea is to fully rewrite my StackOverflow template, (maybe the json-schema too, but this is another story) using different technologies, the most reasonable that come to my mind are:

- React
- [Custom Elements](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements)


### HELP ❤️

- Is anyone interested in that project?
- Which technologies to do you advice me to choose and why?
Swift 5. What is new?
Tags: swift, ios, macos
Published: 2019-01-28 20:55:02

Swift 5 is ABI stable, which gives direct compatibility with OS without additional layers and backward compatibility between different versions of Swift, beginning from 5.0 version.

Also the new version has a lot of improvements:
1. **Flattened `try?` with Optional type**
  No more `double guard`.
    ![pic_1]
  

2. **Raw strings**
  Gives one of the possibility to write a string without escaping characters   inside. It's very feature for writing raw RegEx expressions in a clean way.

    ![pic_2]

    If you need to embed a variable inside a raw string, you must add hash symbol after backslash: `#"(\\|\#(variable))"#`

3. **String interpolation**
Declaration can be flexible and behave on your own.
For this, extend the protocol `StringInterpolation` with own function:
  ![pic_3]

4. **No recursion inside computed properties**
Avoid additional layer for computations, and have it inside a closure.

  ![pic_4]

---
It was a part of described features, more is there: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_beta_release_notes/swift_5_release_notes_for_xcode_10_2_beta

Article on Medium: https://medium.com/@dimpiax/swift-5-what-is-new-examples-fbb64d525486

[pic_1]: https://thepracticaldev.s3.amazonaws.com/i/lbtmunzltsocnujwnz91.png
[pic_2]: https://thepracticaldev.s3.amazonaws.com/i/ky29xr6whta0q722urkf.png
[pic_3]: https://thepracticaldev.s3.amazonaws.com/i/4c9zydtj9x4ztbp34j0q.png
[pic_4]: https://thepracticaldev.s3.amazonaws.com/i/w01yowdw0odxgn6hpoke.png
Ethereum / Solidity Smart Contract BEGINNER Tutorial - Create 5 Smart Contracts
Tags: solidity, ethereum, tutorial, remix
Published: 2019-01-28 20:41:35

---
title: Ethereum / Solidity Smart Contract BEGINNER Tutorial - Create 5 Smart Contracts
published: true
description: 
tags: Solidity, Ethereum, Tutorial, Remix
---

[![](https://thepracticaldev.s3.amazonaws.com/i/p5uzjix9a7dckl3rffen.png)](https://youtu.be/togl4DdYah0)

Learn to develop Ethereum / Solidity smart contracts by building 5 smart contracts, of increasing difficulty. Uses Remix, the online IDE for Solidity. Works on Windows, Linux and Mac, no need to install anything. 

This is a free part of the "Smart Contract 30 course", where we build together 30 smart contracts.

- Full Smart contract 30 course:
https://eattheblocks-pro.teachable.com/p/smart-contract-30
- Become a free member of EatTheBlocks Pro:
https://sso.teachable.com/secure/262058/users/sign_up
- Become a paid member of EatTheBlocks Pro:
https://eattheblocks-pro.teachable.com/p/all-access-monthly-subscription
A Different Kind of War
Tags: webdev
Published: 2019-01-28 20:05:53

---
title: A Different Kind of War
published: true
description: My response to a tweet I found to be interesting
tags: webdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/4fbgm4pe0whyerg9vo9p.jpg
---

I came across the following twitter thread and wanted to respond, but it's a bit more complex than can fit in a tweet:

{% twitter 1089611136666927106 %}
{% twitter 1089611137459671040 %}
{% twitter 1089611138176860161 %}
{% twitter 1089611138906636290 %}

It immediately reminded me of a section of a [fantastic analysis by Mark Nutter](https://hackernoon.com/modern-web-development-bf0b2ef0e22e) from a couple years ago. He inferred that Google's deep ties to the web (and standards bodies) make the web, as a platform, a risk that Facebook does not want to be exposed to. He says that React is a step toward abstracting away the browser.

[Gramshackle follows up on the Google/Facebook relationship](https://medium.com/@Gramshackle/the-web-of-native-apps-ii-google-and-facebook-ed2ee497302d) and outlines what he believes would need to take place for Facebook to usurp Google. He identifies React Native as a way to add an abstraction layer over mobile platforms, and GraphQL as a replacement for REST. They may even be targeting HTTP itself, which is a frightening thought given how fundamental it is to the world.

I find that to be entirely plausible and even likely. JS-JS-JS vs HTML-CSS-JS is only about abstracting the browser as a result of one corporation trying to thrive in an ecosystem dominated by an actor who isn't them.

So I agree, it feels like a war for the future of the web, with standards bodies used as weapons (note: GraphQL and JSX are standards, but not W3C), but not targeted towards web developers and not based on team size (we're just caught in the middle). But it's a war we've seen before. Mac or PC? What came about is the browser abstracting away the OS, and other form factors contributing to the success of the browser as a platform. Google won that war. Now Facebook is using a similar playbook in our latest round of tech wars.

If you're unaware of Facebook's intentions, it can be absolutely frustrating how they stomp all over years of web platform evolution. And the current lack of an alternative to the web can make it seem like they're just a bunch of crazies.

But something I've noticed with the most recent generation of tech is the amazing documentation and ease of use, which I believe is there because creators really, really want you to use their stuff. Take [GatsbyJS](https://www.gatsbyjs.org/) and their amazing tutorial series. I'll admit that the underlying complexity is oppressive, but it's made so that a single person can grasp the tools and use them effectively.

I think everything that is going on is narrowing the gap between large and small teams, and am glad to see the industry moving in that direction.
Extremes (in) Programming
Tags: discuss, programming
Published: 2019-01-28 19:50:41

---
title: Extremes (in) Programming
published: true
description: 
tags: discuss, programming
---

There are plenty of great articles on here for various programming languages / libraries and so I thought I'd write my first article on another aspect of programming - what I'm calling the Extremes in Programming.

I saw [this tweet from Jen Simmons](https://twitter.com/jensimmons/status/1089611136666927106) and thought it was a good time to discuss the topic of why people polarise towards one approach, often declaring it's the One True Way.

I've come across many examples over the years, here's just a few:

- I would **never** use a SPA framework and the counter, I would **always** use a SPA framework.

- I would **always** use Stored Procedures versus I would **never** use Stored Procedures.

- I **always** use Microsoft products versus **I wouldn't touch M$ with a barge pole**.


In all of the examples above, and any other come to that, surely we should just be picking the right tool for the right job?