teleren/devto huggingface dataset:
Bash! Bash! Bang! Bang!
Tags: bash, linux, beginners, commandline
Published: 2019-02-07 12:22:55

---
title: Bash! Bash! Bang! Bang!
published: true
description: Just a quick tip for bashing about whatever shell you happen to use.
tags: Bash, Linux, Beginner, Command-line
cover_image: https://thepracticaldev.s3.amazonaws.com/i/zqm4gbj7iig1d1evahzy.png
---

#The Bang Bang (!!)

What is the Bang Bang?  Typing two exclamation points into your command-line and hitting your enter key with as much force as you can muster.
  
#!! = Play the last command again, Sam.

##Example:

Say you are installing an npm package globally (as you do): -

`npm install -g <package_name>`

Only to receive lots of permission denied errors.  That’s right, you’ve forgotten to use “sudo” again, haven’t you!

You could press the up arrow and then navigate to the start of the line and type “sudo”, hit space and then meekly press the enter key.

Instead, though, you can roll out the almighty Bang Bang: - 

`sudo !!` ![boom](https://thepracticaldev.s3.amazonaws.com/i/zcb020lvonv063e9br02.png)

In our example, that is equivalent to: -

`sudo npm install –g <package_name>`

You will eventually be using this shortcut everywhere you can.  
After travelling to work only to realise you have forgotten your pass, just think -

`pick up pass !!`

Then, if that doesn't work, deploy the big guns: - 

`sudo !!`

Problem solved.
Why Headless CMS & GraphQL are a Natural Fit
Tags: javascript, webdev, showdev, graphql
Published: 2019-02-07 18:33:16

---
title: Why Headless CMS & GraphQL are a Natural Fit
published: true
tags: javascript, webdev, showdev, graphql
canonical_url: https://snipcart.com/blog/headless-cms-graphql-takeshape-tutorial
---

![How to Leverage GraphQL with a Headless CMS [Takeshape Tutorial]](https://snipcart.com/media/204053/headless-cms-graphql-demo.png)

The first time we wrote about GraphQL, back in 2017, [we described it](https://snipcart.com/blog/graphql-nodejs-express-tutorial) as a shiny new tool developed by Facebook.

GraphCMS, which we presented in that article, was one of the first softwares to use it as a core feature.

It was just another drop in a sea of development tools. No biggie, right?

Not quite.

**I think we can all agree that GraphQL is now integral to the modern web ecosystem.**

*Proof #1*: the number of static site generators and headless CMSs making it a prime built-in feature has been skyrocketing in the last few months.

One of them being [TakeShape.io](https://www.takeshape.io/), which I’ll explore further in a technical demo at the end of this post.

First, I want to take a look at:

- The state of GraphQL in 2019
- The benefits it brings to headless CMSs
- The tools that feature GraphQL
- An introduction to TakeShape.io

Let’s begin by wrapping our heads around the concepts behind GraphQL.

## 1. Getting up-to-date with GraphQL

![graphql-headless-cms](https://snipcart.com/media/204052/graphql.png)

You may be reading without even knowing what GraphQL really is. For clarity’s sake, **it’s a query language for APIs that defines how to fetch data from one or many databases**.

> For a proper technical GraphQL introduction I suggest [our first post](https://snipcart.com/blog/graphql-nodejs-express-tutorial) on the matter.

A lot has changed since its first use case with FB mobile apps back in 2012, mostly regarding its adoption. GraphQL was open-sourced in 2015, giving it an initial burst of life for a larger number of devs. 4 years later, its rising presence in our industry is undeniable. 

*Proof #2 that GraphQL is an integral part of web development*: its adoption by tech giants. Apart from Facebook, other major players like GitHub, Shopify, Pinterest, Paypal & Twitter all use GraphQL in some way or another.
  

→ Read the full post and technical tutorial [here](https://snipcart.com/blog/headless-cms-graphql-takeshape-tutorial)
VGauge - Created My First NPM Package (First Post)
Tags: vue, firstpost, showdev
Published: 2019-02-07 08:50:00

---
title: VGauge - Created My First NPM Package (First Post)
published: true
description: My first NPM package ever, and first post too :)
tags: Vue, First Post, showdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/lfqlpen3xumco2gpcnrm.PNG
---

Hello Everyone,

My 2019 resolution was to get more involved with the open source community, and contribute as much as I can.

I had to create a dashboard for work, and they needed to see gauges, the simplest library I found was [GaugeJS](https://github.com/bernii/gauge.js/)

The problem was it was too scattered around to use in my project, so I created a wrapper for it.

I went through the process of creating the package and publishing it.

The process was fairly simple following the NPM docs.

It's such a satisfying feeling to do ```npm i vgauge``` and it actually works.

Here's the [github page](https://github.com/amroessam/vgauge), a live [demo](https://jz3qoxny63.codesandbox.io/), and the [sandbox](https://codesandbox.io/s/jz3qoxny63) if you want to tinker

Please don't hesitate to tell me what you think.

Thank you for reading :)
Podcast: Leo Polovets, software engineer turned VC, on early stage engineering & personal moats. 
Tags: podcast, startup, advice, career
Published: 2019-02-07 07:14:02

---
title: Podcast: Leo Polovets, software engineer turned VC, on early stage engineering & personal moats. 
published: true
description: 
tags: #podcast, #startups, #advice #career
---

Great episode on company moats and Leo's transition from operating to early stage investing. 

Some takeaways: 

- Technology and teams are typically not defensible: tech can easily be copied and your competitors can ultimately hire more people or find ways to work harder than you. Leo shares what makes companies defensible today and how early engineers typically build less complex products, but play a fast-paced, customer-facing role.

- Personal growth is hard to see when it's happening, so it's important to keep going. People won't remember one blog post, but they'll remember a dozen. In music, people will 'like a song,' but it takes time to recognize an artist and become a fan of their work. 

- Leo talks about 'covering a larger surface area for luck,' which he describes as meeting as many people as possible and find ways to be as helpful as possible before expecting anything in return. 

Listen here: https://anchor.fm/square-one-conversations-with-the-best-in-business/episodes/E33-Leo-Polovets--General-Partner-at-Susa-Ventures-e2tq62
How did you get better at CSS?
Tags: learning, css, discuss, help
Published: 2019-02-07 06:09:40

---
title: How did you get better at CSS?
published: true
description: How did you practice CSS in order to become comfortable enough with it?
tags: learning, css, discuss, help
---

I've been developing for 2 years now and have been working at my first full-time job as a software developer for 5 months now (not counting my contract work) where I get to spend about 70/30 in backend/frontend respectively.

Whatever frontend work I've done has mostly been focused on placing new components on an Angular app with a sprinkle of CSS and mostly Bootstrap.

Not that my job requires this yet, but I'd like to strengthen my CSS skills so that I can feel confident in my ability to whip up anything I can visually imagine; instead of using a lot of basic CSS to make things look good enough (some position tweaking or color/formatting changes). I want to rely less on Bootstrap.

**What resources have you personally used to improve your CSS skill when you were learning?** I know there's plenty of tutorials out there (and I've access to a few), but for some reason, I can't seem to get the most out of these tutorials since you need to practice CSS enough to get a good knack of things.

Did you have a certain list of web pages, shapes, etc. that you wanted to replicate and just trial and error your way to the end result? Was there a structured path involved? Are there any practical/online resources available that you found particularly useful?

My motivation/Why: I do mostly backend, but I'd like to be able to whip up mocks for my personal endeavors/side projects more confidently.
What does a UI Component mean, finally ?
Tags: react, javascript, ui
Published: 2019-02-07 05:47:16

---
title: What does a UI Component mean, finally ?
published: true
description: 
tags: reactjs, javascript, ui
---

I need to clarify myself some terminologies that i found too ambigous, or useless to apply in daily programming, some of them is: UI, Component, Behaviour, View, Model.

I could describe a `Component` as:

```js
Component = function(behavior, view)
```

What does `behavior` mean ?

```js
behavior = function(props) -> model
```
Yes, a `behavior` is a function, which receives `props` as input, and return a `model`

A `model` in this case is just any data structure.

What does a `view` mean ?

```js
view = function(model) -> UI
```

A `view` is a function which receives a `model` and returns a `UI` .

`UI` means User Interface, is what a user could see, feel and interact with.

## Example:

Let's make a `Counter` component with React and Hooks !

This is the `makeComponent`, which receives a `behavior`, a `view` and returns a `Component`

```js
import React from 'react'

const Component = ({behavior, view, ...rest}) => {
  const props = behavior(rest)
  const View = view
  return <View {...props} />
}
const makeComponent = (behavior, view) => {
  return (props) => <Component {...props} behaviour={behaviour} view={view} />
}

export default makeComponent
```

The `Counter` behavior:

```js
import {useState, useCallback} from 'react'

const behavior = ({initialCount}) => {
  const [count, setCount] = useState(initialCount)
  const increment = useCallback(() => setCount(count + 1))
  const decrement = useCallback(() => setCount(count - 1))
  return {initialCount, count, increment, decrement}
}
```

The `Counter` view:

```js
const view = ({initialCount, count, increment, decrement}) => {
  return (
    <div>
        <button onClick={increment}>+</button>
        <div>Current count: {count}</div>
        <button onClick={decrement}>-</button>
    </div>
  )
}
```

Finally, let's make a `Counter` component:

```js
const Counter = makeComponent(behavior, view)

React.render(<Counter initialCount={0} />, body)
```

Voilla, i got a clean React component !

## But, is this `MVC` ?

Yes ! The `behavior` is exactly what does a `controller` mean.

## So, is a `Component` the same as `MVC` ?

No ! `Component` has only two arguments: The V and the C, there's no M.
Thank you for the 50K+ views!
Tags: thanks, showdev
Published: 2019-02-07 05:18:19

---
title: Thank you for the 50K+ views!
published: true
description: I received over 50,000 views on my post and I want to say thank you!
tags: thanks, showdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/89proqbjdbxz4fh8bqtp.png
---

I had an article on here [25 years of coding, and I'm just beginning](https://dev.to/dechamp/25-years-of-coding-and-im-just-beginning-442n), get some attention a week or so back. I was shocked to see the response I got, when I opened up about some of my insecurities, fears and thoughts.

I ended up with over 50K views on my post, and over 5000 visitors to my site https://gidgitz.com. And more importantly, with many people reaching out to me to tell me their personal stories and how they were able to relate. It's a pretty awesome feeling! 

So this is me, saying thank you! Thanks to the 51,458 views! And the personal stories you shared.

![50K views](https://thepracticaldev.s3.amazonaws.com/i/eqaz8l7luv4zk4enl8lg.png)

--DeChamp
Best Ways To Get Great Ideas
Tags: innovation, motivation, inspiration, business
Published: 2019-02-07 05:17:09

---
title: Best Ways To Get Great Ideas
published: true
description: tips to get great ideas 
tags: innovation, motivation, inspiration, business
---
These are some simple tricks to get solutions for a problem or ideas for a new business:

<b>1- Disconnect</b>

The smartphone is one of the biggest distraction. You might be so close to the solution of a problem and suddenly, the phone rings or you get a notification or even a message that teleports you from a world full of innovation to the real world.

My advice to you is to train yourself to take 5 minutes to break from the real world everyday. Isolate yourself in a room, turn off your phone and put it in another room and just close your eyes and think from outside the box. Think as if you’re dead and you’re watching yourself from a top view.

<b>2- Meditate</b>

Bill Gates and many other successful people meditate once for at least 5 minutes everyday. The above advice will lead you to meditate. While meditating, free your mind from all kind of information, therefore, more space will be available in your brain to accept new ideas and thoughts.

<b>Related Article:</b> <a href="https://dev.to/hussein_cheayto/why-i-started-programming-35dj">Why I Started Programming</a>

<b3- Keep a notebook next to your bed</b>

One of the most important tricks is to keep a notebook and a pen next to your bed. You can use your smartphone also as a notebook. Before you sleep, many ideas come to your mind because your brain has time to search for answers for a specific problem since you’re in a rest state, hence your brain digs down in your unconscious and in your intelligence to solve the problem that you weren’t able to resolve.

As a conclusion, I hope that these tricks will help you to find a solution for all your problems and to be more innovative.

<b>Related Article:</b> <a href="https://dev.to/hussein_cheayto/what-i-learned-from-my-first-published-game-2d3c">What I learned from my first published game</a>
"Read" feature for posts on dev.to
Tags: featurerequest, dev
Published: 2019-02-07 04:50:18

---
title: "Read" feature for posts on dev.to
published: true
description: 
tags: #requestforpost #featurerequest #dev
---
Hi DEV team, 
You people have done a fabulous job in keeping the dev community together. Kudos !

Being a blog reader, I'll always have dev.to website open even at my workplace. The only difficulty is to keep track of what posts I've already read. This becomes even worse when the network refreshes. 

So, my request is about whether a feature like "post read" can be added on 'posts scrolled above x%'. Also, I'm not able to figure out how the posts are ordered. [They seem random sometimes, not chronological].

Thank you.

Happy coding everyone.
Value in Dedicated Testing
Tags: testing
Published: 2019-02-07 04:46:03

---
title: Value in Dedicated Testing
published: true
description: 
tags: testing
---

What is software testing? What does a software tester do? What benefits do they bring to the table? James Bach has been trying save software testing by defining it a craft. But when you're hired to do software testing, you may not be tasked with the craft defined. So I want to put out there what I think I've brought to the table for the quality improvements irrespective of its classification.

I think the number one benefit I've brought into a team has been the investigative skills to make it possible to reproduce an issue and drill down into the cause of the issue. This means an issue has already been found and identified, many times when I've come into the team there is no infrastructure to handle observing and manipulating the system to understanding the behavior or to inject events known to be happening.

This type of value is very different from the expected role tasks. I'm expected to find the issue before any others see it. I'm expected to verify the developer met the requirements specified. I'm expected to check that all previous specified requirements continue to meet the defined behavior. All of these are things I participate in to some level. However I am looking at the changes and the system and taking my best guess effort to cover the critical areas at risk for the changes taking place. This means I spend my time eliminating entire classification and areas of tests in order to meet reasonable quality confidence in a reasonable time period.

I also participate in building out regression automation. The automation is helpful in calling out regression but I also believe certain focus I defined above can reduce the value of these regression tests. However, what I have recently determined to convince myself of some regression tests I consider low risk as still a major value in providing confidence. The focus here is that these low risk tests provide a coverage that eliminates classification of failure, such that when an issue does occur in the general area, focus can be directed quickly away from these low risk areas into areas less understood or covered.

The other aspect to the automated testing I end up writing is it provides the possibility to add the regression tests that cover many different types of situations. I'm still very diligent about where I focus my efforts to places known to be problems, but one of the challenges is convincing people that the symptoms which they see aren't always the problems which need the focus.

QA is not looking for what to test, but what not to test. There are so many things that constitute a test the search is actually being able to eliminate what can be left off for the release. This can come from risk, severity, code changes, and so much more.
Git file renaming issues (deleting/adding instead of renaming)
Tags: help, git, github
Published: 2019-02-07 03:10:19

---
title: Git file renaming issues (deleting/adding instead of renaming)
published: true
tags: help, git, github
cover_image: https://thepracticaldev.s3.amazonaws.com/i/cu5csch4pwfki2r0yfac.jpg
---

Hey folks, I need a little help as I've kind of reached the extend of my gitfu.

I'm [working on a PR](https://github.com/sindresorhus/refined-github/pull/1750#issuecomment-460886960) and I didn't realise at the time, but some files were committed as a deleted file (the original file) and a new file (the rename of the old file) when I renamed some of them. I was asked to ensure it's renamed in Git so as to preserve the history. Fair enough.

So if you look at the comments in the PR (I link to the first one about renaming in there), you'll see that I've done the following in a few different was but here is the gist of it:

- Recovered the deleted file, `source/libs/icons.js`
- Deleted the new file, `source/libs/icons.tsx`
- Commit those changes
- Run a `git mv source/libs/icons.js source/libs/icons.tsx`
- Push to the remote, and the PR shows it as a file rename with no file changes.
- The next commit is putting back the changes I had in `source/libs/icons.tsx`.
- Push to the remote, and the PR shows that `source/libs/icons.js` has been deleted and `source/libs/icons.tsx` has been added.

I've even had one of the maintainers of the repo try to give me a hand, but he ends up in the same predicament as I do.

Any suggestions gitfolk?


Photo by [Markus Spiske](https://unsplash.com/photos/xekxE_VR0Ec?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/search/photos/source-control?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)
Help gathering data
Tags: discuss, askdev
Published: 2019-02-07 02:03:50

I don't even really know where to start, so I figure I'll just throw this out there and see where it goes.

My daughter is disabled. She's in sports and dance, but it's taken my wife and I years to find out about the organizations she's now in, and that's mostly through word of mouth. Other families have told us because they've had the years of experience that we didn't. And now we're passing the information on to other less experienced families. And that's a problem that everyone we've talked to agrees upon: there's really no good way of discovering what organizations are out there, and what they can help with.

There exist some sites out there like https://www.challengedathletes.org/resources/ which are really just lists of sites, but really nothing more to indicate that this group has wheelchair basketball, that group has adaptive ballet, that kind of thing. So I'm thinking, what if I built a site that provided an index. Searchable, faceted, like Algolia or AWS Cloudsearch. That part I can do. But how would I go about gathering the information? Could I somehow scrape it? If so, how do I organize it? Do I crowdsource by petitioning /r/disability, the Facebook support groups my family belongs to, and other places across the interwebs?

I can design the data model. I can build the webapp. I can make it fast and pretty and easy to use. But how do I get the data?
Hello World!
Tags: personalnews, career, writing, learning
Published: 2019-02-07 01:19:50

---
title: Hello World!
published: true
description: My first post, in dev.to
tags: personalnews, career, writing, learning
---

_Hello World!_ A simple and classic message, yet, with a lot of personal meaning behind:

```javascript
// It's the first thing I use
// when learning a new programming language
// before doing a TODO application :P
console.log('Hello world!');


/* ... */
// some times I use it
// for doing a quick debug
console.log('Hello world!'); // Why is this not working?! (╯°□°）╯︵ ┻━┻
/* ... */
```

I start this adventure, of writing this blog, with some objects that I like to share:
1. Improve my english writing/communication skills.
2. To write small and incremental posts that later I will condense in a free game programming book that I want to write.
3. A way to give back to others, like others gave to me.
4. To improve my understanding of subjects that I'm learning.
5. And lastly to connect with others.

In future posts I will delve in more detail about things I'm learning, the book I want to write and why trying to explain to others something, can help us to learn more about it.

PS: If you see some typos, grammar errors etc, let me know on the comments!
Greenfield Wordpress Plugin Development in 2019
Tags: wordpress, php, requestforpost
Published: 2019-02-07 01:13:39

---
title: Greenfield Wordpress Plugin Development in 2019
published: true
description: Questions regarding starting a new wordpress plugin in 2019
tags: #wordpress #php #requestforpost
---

A great number of my potential (and hopefully future) customers use WordPress and ALL of my beta customers use Wordpress.  The field I'm in requires that my clients have some type of web presence, basically a 'brochure' website and of course that's a field WordPress seems to cover quite well.

My question is regarding writing a plugin for my customer's website that integrates with the services I offer.  I have roughly 12 years of PHP experience (last touched 5.3 or so somewhere around 2009) and I know it's changed but coding it shouldn't be an issue for me. I do have questions:

* What version of Wordpress should I aim for? 4.9 (which requires PHP 5.2...)

* What version of PHP should I target?  I know this relates directly to the question above, but 5.4.x is dead and no longer supported, right?

* How hard is it for a customer to upgrade Wordpress versions? I seem to remember that upgrading Drupal 6.x websites was a nightmare and you'd better have your backup ready to go.

* Is PHP 7.3 compatible with Wordpress 4.9?

Basically, if someone could do a greenfield Wordpress Plugin write up in 2019 I'd be thrilled.