teleren/devto huggingface dataset:
The development graveyard
Tags: webdev, sideprojects, beginners
Published: 2019-10-09 22:10:04

Most web developers will sympathize with this.

You’re working on an exciting personal project utilizing the latest and greatest framework. The late-night hours you have spent are paying off, and despite your fatigue, you are adamant to complete it and share it with the world. But then life happened. Work becomes pretty intense and the mere idea of opening up your laptop when you get home makes you anxious and break into a cold sweat. Sound familiar?

A month or two pass, your job has settled down and you can now find the time to dive right back into your project, but there is a problem. The code you wrote back then was under thought, you have no idea where to start and the project does not capture your attention anymore. Put simply, you lost momentum and focus.

These kinds of projects eventually end up in what I call the **Development Graveyard**. A place where a project dies and often never get resurrected. This may seem like a bad thing but in reality, it’s not, allow me to explain.

Your graveyard can be a source of learning, reflecting and aid you in your current web development projects.

Regardless of how bad or incomplete these projects may seem to be, they provide a treasure trove of great code references. This code can likely help you with your current projects. Sometimes just seeing old code can give you an altered perspective to solve current development problems.

The same goes for your job. Your client could be asking for something very specific and you just happened to build something like this a year ago. Since you have a development graveyard in place, your ability to use it as a valuable resource. Imagine the time savings if you were able to leverage some of your old code. Your boss will love you!

Finally, it shows how you have progressed over time which makes you feel accomplished. I often look back at my old work and can’t believe how I have come and how far technology has progressed. Take this a confidence booster and a learning tool.

If you have a graveyard already or would like to bury some old work, I would suggest adding a readme file, so you can get a quick summary of what you are working on. Some of you might be doing this already. But there is nothing worse than looking at a codebase and wondering what the heck it is for what it does. And of course, store it in a repo.

*Personally, my graveyard is sprawling. But it serves as a place to visit when I forgot how to do something. Or when I need a little inspiration. But it would be nice to not send projects out to pasture, wouldn’t it? Of course, and that’s for another post I’m writing.*

Celebrate your graveyard. Visit it often and learn from it.
How to friend Pug and Svelte 
Published: 2019-10-09 21:22:29

`SvelteJS` is great! In recent days I have been using it for my new project and I am delighted. But at one moment I wanted to combine `SvelteJS` with my favorite preprocessor `Pug`. This task is not so simple as one can think. 

`SvelteJS`'s authors recommend to use `Rollup` for module compiling. I am not so familiar with this tool, but I have found out how to use it and how to integrate `pug` and `coffeescript` preprocessors in it. But result disappointed me: `pug`-part works fine, but special symbols in `script`-part break compilation. Finally, I invented simple hack, that let me to reuse my `pug`-components.

So, there is a recipe. Firstly, let's create some `pug`-file:

```pug
script.
    let postUrl
    let postMessage
    let save = ()=> alert('save')
    // and so on
form
    .columns
        .column
            .field
                .control
                    input.input.is-primary(bind:this='{postUrl}')
        .column.is-narrow
            a.button.is-white(on:click='{showLink}')
                span.icon
                    i.fas.fa-link
    .field
        .control
            textarea.textarea(maxlength=350 rows=6 bind:this='{postMessage}')

.buttons.has-text-right(style='width: 100%')
    button.button.is-primary.is-normal(on:click='{save}')     Save
    button.button.is-primary.is-normal(on:click='{post}')     Post
    button.button.is-primary.is-normal(on:click='{schedule}') Schedule
    button.button.is-primary.is-normal(on:click='{remove}')   Remove

```

Never mind what it is for. Main thought here is that the pug-code can be pretty complex, with includes and variables.

Let's name this file as `PostEditor.pug` and compile it with some special options:

```bash
pug --pretty -E svelte PostEditor.pug
```

Option `-E` means here extension of resulting file. That's all! You have got useful template, where You can develop `script`-part.

```html
<script>
  let postUrl
  let postMessage
  let save = ()=> alert('save')
  // and so on
</script>
<form>
  <div class="columns">
    <div class="column">
      <div class="field">
        <div class="control">
          <input class="input is-primary" bind:this="{postUrl}"/>
        </div>
      </div>
    </div>
    <div class="column is-narrow"><a class="button is-white" on:click="{showLink}"><span class="icon"><i class="fas fa-link"></i></span></a></div>
  </div>
  <div class="field">
    <div class="control">
      <textarea class="textarea" maxlength="350" rows="6" bind:this="{postMessage}"></textarea>
    </div>
  </div>
</form>
<div class="buttons has-text-right" style="width: 100%">
  <button class="button is-primary is-normal" on:click="{save}">    Save</button>
  <button class="button is-primary is-normal" on:click="{post}">    Post</button>
  <button class="button is-primary is-normal" on:click="{schedule}">Schedule</button>
  <button class="button is-primary is-normal" on:click="{remove}">  Remove</button>
</div>
```
Of course, You have to remove some quote-marks with your hands now, but it is not so complex task.
The Cult of Productivity 
Tags: productivity
Published: 2019-10-09 20:57:37

---
title:The Cult of Productivity 
published: true
description: 
tags: productivity
---

To draw out. 
To lead on. 
To lengthen.
 
Productivity, from it's Latin, is the drawing out, the leading out, the lengthening of a thing from it's originary place.  We are steeped in adoration for it. Unable, often, to to maximize the other variables of our economy, the wizards of our capitalism have focused on productivity. It's an enchanted buzz-word fetishized by talking heads on youtube and an iconography of clipart hands and meaningless arrows. So we've set about making the landscape around us more fertile: ambient lo-fi Spotify playlists plow the fields we let fallow overnight to restorative rituals of yoga and online-shopping-as-self-care. Little careless consumerist steps to eek out every drop of productivity from our nitrogen-fixed lives. But this is not a bettering-of, a finishing-of, a making-of; *productere* is elongation. Our work becomes a litch-like parody of itself: neither living, nor able to die. We are absolutely antagonistic to discrete accomplishment as we search for ways to work more productively. We draw it out, ever longer, never better, into a place that work does not belong. 

All works of quality are final in their completion. All days of harvest are followed by evenings of rest. All of the good works we do must end...

*tamen producentur* 


---
Cultus is always distinguishable from industry, even when the worshipper's motives are most sordid and his notions most material; for in religious operations the changes worked or expected can never be traced consecutively.
   -George Santayana, *Reason in Religion*
Appium Tools for Rapid Development of Functional and Performance Test
Tags: appium, test, performance
Published: 2019-10-09 20:35:20

**Wednesday, Nov 5, 2019 |  9:00AM - 10:00AM (Pacific Standard Time) | 1 Hour**

[Register for the webinar](https://info.headspin.io/webinar/appium-tools-for-rapid-development-functional-and-performance-test?utm_source=devto&utm_medium=referral&utm_campaign=appium&utm_term=jlipps)

In this webinar we'll take a look at several tools we can use to 
accelerate the development and debugging of Appium scripts for functional testing and performance testing. 

Specifically, we’ll cover:

- Overview of functional and performance testing

- Appium Desktop, which is an all-in-one Appium server plus inspector tool. How to inspect and debug mobile web and hybrid apps.

- web2driver, a browser-based Appium client which can be used as the foundation for a whole new category of tools.

- The new HeadSpin Recorder, built on web2driver, which allows for rapid development of geo-distributed cross-device testing.

- Appium’s Event Parser, which can be used to visualize the timeline of an Appium session to help discover bottlenecks.


**About the Speaker**

**Johnathan Lipps - Architect and Project Lead, Appium**

Jonathan is the architect and project lead for Appium, the popular open source automation framework. He is the founding Principal of Cloud Grey, a consulting firm devoted to helping clients leverage the power of Appium successfully, and is also an advisor to HeadSpin. He has worked as a programmer in tech startups for over 15 years, but is also passionate about academic discussion. Jonathan has master’s degrees in philosophy and linguistics, from Stanford and Oxford respectively. Living in Vancouver, he’s an avid musician, and also writes on the philosophy of technology.
Sex4Grade Open source project 
Published: 2019-10-09 20:24:02

Hi, Folks, like we all know the latest cause and trend in Nigeria university. Twitter remains one of the platform that allow freedom of speech. However, I have successfully scraped the dataset from #Sex4Grades and #BBCAfricaEye.

For those who want to work on Open Source Data Science project, this is your calling. Also don't forget this project is part of #Hackotberfest challenge. So participate in it and stand a chance to win a T-shirt from Hackotberfest

I have created some issues that you are familiar with, you can start from there and don't forget to send a PR when you perform a task.

Here is the link to the GitHub page 


https://github.com/Emekaborisama/Sex4Grades/issues
Simplifying my old event bus architecture with Bull
Tags: webdev, javascript
Published: 2019-10-09 20:12:18



## The why

So before [I posted](https://dev.to/dropconfig/aws-sns-sqs-event-bus-8mf) about an event bus with AWS SNS and SQS. I think it works really well and it's pretty cool. It did have some rough edges that bothered me though. 

* There was a lot of manual setup in production.
	* There are scripts etc that can do this but I was having to make the queue and SNS topic and link them for every new queue I wanted to make
* Local dev was messy
	* There are fairly solid Docker images that imitate SNS and SQS but the setup in code felt very messy.
* Our task worker code, while cool, felt fragile.

So how does bull help? 

Task worker management:

 They have a solid interface for registering and running task workers. Making it much less work on our end to handle that part of the code. 

Keeping all the code contained:

 All pieces of the flow exist in the same codebase. Queue creation, event passing and task running without external setup for production.

Less moving parts: 

In the previous iteration you had SNS, SQS, custom task handler code, and server code. The updated version uses just server code, Bull, and Redis. While only one less system is used in the updated version. We reap many benefits from the battle tested, and frankly much better, Bull code. 

Portability:

Our task code now only relies on Redis. This makes it much easier to move to another cloud provider. No code changes required. 


## The How

So it's pretty simple to implement. (You can refer to the [Bull documentation](https://github.com/OptimalBits/bull) for most of this as well.)

#### Setting up queues

We make a queue for each type of work we want to do. Such as emailing or sending texts.

```javascript
const emailQueue = new Queue('email', 'redis://127.0.0.1:6379');
const smsQueue = new Queue('sms', 'redis://127.0.0.1:6379');
```

Then we have all our queues in an array so when an event comes in we can pass that to all our queues

```javascript
const queues = [emailQueue, smsQueue];

function onEvent(name, data){
    queues.forEach((queue)=>{
			queue.add({
			    name,
			    data
			})
    })
} 
```

And we can define our queue processors.

```
emailQueue.process(emailTaskWorker);
```

Pretty simple stuff. 

### Final thoughts.

Why pass events to all queues? It allows any any queue to decide what it wants to do. 

For example. If a user commented on a post, we might want to email them, text them, or generate a push notification. If in our code we did:

```javascript
server.post("/posts/:id/comment, (req) => {
	server.sendEmail(req)
	server.sendText(req)
	server.sendPush(req)
})
```

That would get really messy. Instead we just make a record of what event happened.

```javascript
server.createEvent("user-commented-on-post", {post, user});
```

Now any queue that cares about that event can do whatever it wants in response. It keeps our http handler code very clean as well.
What is HTTP? How the Internet Works!
Tags: http, tutorial, webdev
Published: 2019-10-09 20:02:51

1st video on my comprehensive responsive web design series I'm releasing on YouTube!  Learn about HTTP, Headers, and general "Internet Infrastructure" in this easy-to-digest beginner tutorial

[Subscribe To The Channel!](http://www.youtube.com/FollowAndrew?sub_confirmation=1)

{% youtube wW2A5SZ3GkI %}

##How Do Networks Work?
Believe it or not, the vast majority of internet traffic is done through physically connected computers.  In order to connect the continents together, large telecom companies lay underwater sea cables on the ocean floor!  This is what enables the global world wide web to move so quickly, as these large cables are fiber-optics, and travel at the speed of light!

![submarine cable map](https://thepracticaldev.s3.amazonaws.com/i/4x4n0ylxigbrv65dx1q4.png)
- image screenshot from submarinecablemap.com

##HTTP
Hyper Text Transfer Protocol is made up of a simple request -> response cycle between a local machine (client) and a remote machine (server)

![http cycle](https://thepracticaldev.s3.amazonaws.com/i/srugx5l3xu6vo5hhczh2.png)

## The Request
When a request is made to a server, it has 3 important pieces of information that are sent from the client
* Start Lines
 * Method
 * Target
 * Version
* Headers
* Body

![http request](https://thepracticaldev.s3.amazonaws.com/i/vrcwejeqpk9bhw54afww.png)

## The Response
Being that HTTP is a stateless protocol (meaning no persistent connection is kept between the client and server machine) when a server receives a request, it simply answers with a response, which looks like this:
* Start Lines
 * Version
 * Status Code
 * Text
* Headers
* Body

![http response](https://thepracticaldev.s3.amazonaws.com/i/ekm9k2vplkv1atof9g6h.png)

## HTTP Response Status Codes
The status code that is reported from the server is a 3 digit number, and tells the browser if everything was okay, or if something went wrong.  Here are some common status codes:
* 1xx Informational
* 2xx Success
 * 200 (Success)
* 3xx Redirection
* 4xx Client Error
 * 404 (Page Not Found)
* 5xx Server Error

## HTTP Headers
Lots of information can be transmitted about the client and server computers in the 'headers' section of that cycle.  Information such as timestamps, ip addresses, server capabilities, browser information, cookies, etc. can all be transmitted.  Here is an actual look at a request and response header from a page request:

![http headers](https://thepracticaldev.s3.amazonaws.com/i/i4ds9ccqgq7a9qrkonct.png)

HTTP is based on TCP/IP, and has several versions (version 2 is common today).  There is a lot more to learn about HTTP, specifically in relation to IP addresses, but we'll save that for a future tutorial.
Brief Understanding on Laravel Repository Pattern Design
Tags: laravel, laravel58, laravel6, laravelcodesnippet
Published: 2020-01-02 18:51:11

---
title: Brief Understanding on Laravel Repository Pattern Design
published: true
date: 2019-10-09 19:56:41 UTC
tags: Laravel,Laravel 5.8,Laravel 6,Laravel Code Snippet
canonical_url: https://codebriefly.com/brief-understanding-on-laravel-repository-pattern-design/
---

 ![Laravel Repository Pattern Design](https://codebriefly.com/wp-content/uploads/2019/10/repository-pattern.jpg)

In this article, we will discuss the “Laravel Repository Pattern Design”. Using the Repository Pattern, we will add an extra layer between application logic and database. Assume, you want to change your DB from Mysql to MongoDB or anything else. Then Repository Pattern is much beneficial, application logics remain the same and all you have to […]

The post [Brief Understanding on Laravel Repository Pattern Design](https://codebriefly.com/brief-understanding-on-laravel-repository-pattern-design/) appeared first on [Code Briefly](https://codebriefly.com).
Learning Cloud? (Serverless, Kubernetes, Microservices, etc) — What's your biggest frustration?
Tags: discuss, devops, cloud
Published: 2019-10-09 19:28:40

---
title: Learning Cloud? (Serverless, Kubernetes, Microservices, etc) — What's your biggest frustration?
published: true
description: 
cover_image: https://4.bp.blogspot.com/-XHdtYzIyMOE/WOS0bhrBldI/AAAAAAAAWiM/OIyla8KCSQIShpDVKA2F5AMQHoH8WcDKQCLcB/s1600/DevOps%2Ball%2Bpicture.jpeg
tags: discuss, devops, cloud
---

[Cover Image Credit: Thanks James Bowman!](http://www.jamesbowman.me/post/continuous-delivery-tool-landscape/)

I've spent a lot of time recently writing about Cloud Engineering. The more I learn about Cloud, the more I'm humbled (and quite frankly, scared) about how much there is to know...

---

**Wanna learn Serverless?** Sure, you need an **AWS account**, oh and it needs to be setup securely, oh and your Lambda needs an **IAM policy**. Oh and you'll also need to know a **programming language** too, right? Oh! And you'll need to understand **events**... and **logging**, you'll want some of that too... What's the difference between logs and metrics? Who knows! Just remember to **structure those logs**! (What the hells a structured log?). Oh and you wanna make sure your **error handling** is setup right, too. Oh and don't forget to access your Lambda you'll need to hook up to **API Gateway** (maybe you should use **Serverless framework**?). You'll probably wanna learn **infrastructure as code**, too otherwise things will get messy. Oh and since we're building an API we better make that **RESTful** compliant, too. And we'll want an API standard, how about **JSON:API**? Or **GraphQL**? How should we test that? **Integration testing**? On Local?

---

You get the point (ha! And I really, really could keep that example going on!). All that for potentially just a single API...

So my question is: What Cloud technologies are you trying to learn at the moment, and what are some of the hurdles you're facing? What techniques and concepts are you looking into, and what things are you ignoring?

---

Lou is the editor of [The Cloud Native Software Engineering Newsletter](https://newsletter.thedevcoach.co.uk) a Newsletter dedicated to making Cloud Software Engineering more accessible and easy to understand, every 2 weeks you’ll get a digest of the best content for Cloud Native Software Engineers right in your inbox.
What's the most fun part of your job?
Tags: discuss, career, fun, devrel
Published: 2019-10-09 19:07:45

Lately, I've had a ton of fun doing the UI design for a new application we're building at work. I get to do some outreach at my job, which I also really enjoy. 

What's the most fun part of your job?

*Title illustration from [unDraw](https://undraw.co/illustrations).*
The 1000 Day Rule
Tags: startup, indiehacking, bootstrapping, business
Published: 2019-10-09 18:56:13

---
title: The 1000 Day Rule
published: true
description: The 100 Day Rule for Building Up Your Business
cover_image: https://thepracticaldev.s3.amazonaws.com/i/dsnlokv40nd4ba1h9q2t.png
tags: startups, indie hacking, bootstrapping, business
---


I became aware of the 1000 Day Rule on the <a href="https://www.indiehackers.com/podcast/112-tommy-griffith-of-clickminded">Indie Hacker Podcast with Tommy Griffith</a>. In the podcast he basically says that often it takes 1000 days to replace your income.

So I looked it up. On <a href="https://www.tropicalmba.com/living-the-dream/">TropicalMBA</a> it says -

<blockquote>The 1000 Day Rule: Our basic hypothesis: you’ll be doing worse than you were at your job for 1000 days after you start your muse business.</blockquote>

There's a bullet point list in the article above of the different stages of the 1000 days, which I thought was interesting. Yes the post is a bit old. Yes it often refers to the marketing/ebook/affiliate type stuff, but the bullet point journey list is not far off what I experienced.

I then remembered that I posted the <a href="https://www.indiehackers.com/product/ministry-of-testing/crossed-4-million-in-total-revenue--LnqXtnZULYw67N5Yrg0">revenue from Ministry of Testing</a>, and it was in year 3 of proper business building that it actually replaced by proper income. Interesting :)

Obviously, this won't necessarily apply to everyone, but as a general guidance for indie hackers I think it is useful to be aware of. I often see frustrated indie hackers who are new on their journey. where they aren't see results straightaway and give up hope a bit too easily.
Import/export data into/from Firebase Realtime Database from your terminal using HTTPie and Google Cloud SDK
Tags: firebase
Published: 2019-10-09 18:35:37

---
title: Import/export data into/from Firebase Realtime Database from your terminal using HTTPie and Google Cloud SDK
published: true
description: Sometimes you want to upload some JSON data to Firebase Realtime Database but don’t want to fiddle with writing a script and setting service accounts. Here’s one easy way right from your terminal.
tags: Firebase
---

Sometimes you want to upload some JSON data to Firebase Realtime Database. Usually this means generating a service account and writing a script that uses Firebase SDK to upload that data.

However, [Firebase Realtime Database REST API supports Google OAuth2 access tokens](https://firebase.google.com/docs/database/rest/auth).

If you [installed Google Cloud SDK](https://cloud.google.com/sdk/install), such token can be generated using the following command:

```
gcloud auth print-access-token
```

The access token **has access to all projects you own** which makes this very convenient. That means you can now do this:

```
cat FILE.json | \
  http put https://PROJECT.firebaseio.com/REF.json \
    "Authorization: Bearer $(gcloud auth print-access-token)"
```
Selfish Hacktoberfest 2019
Tags: hacktoberfest, meta
Published: 2019-10-09 18:22:20

My last [tutorial](https://dev.to/michelc/crud-application-with-express-and-sqlite-in-10-steps-me0) contains a table of contents. But whatever Markdown I tried, the links never worked :(

So I needed to look under the hood and get my hands dirty...

One issue and one PR later, and everything is working like clockwork again.

{% github https://github.com/thepracticaldev/dev.to/pull/4340 %}

And now, I have to wait (20 minutes) until the fix goes into production, then republish my post in order to rebuild the TOC correctly.

```
**Table of Contents**

1. [Create a new Node project](#crud1)
1. [Add modules to the Node project](#crud2)
1. [Create the Express application](#crud3)
1. [Add EJS views](#crud4)
1. [Use views in Express](#crud5)
1. [First steps with the SQlite3 module](#crud6)
1. [Modify an existing row](#crud7)
1. [Create a new row](#crud8)
1. [Delete a row](#crud9)
1. [Conclusion](#crud10)
```