teleren/devto huggingface dataset:
How to disconnect from Twitter account?
Tags: meta
Published: 2017-10-11 08:46:37

---
title: How to disconnect from Twitter account?
published: true
description: 
tags: #meta
---

My primary loging to dev.to is by my GitHub account.

Then I've connected the *wrong* Twitter account to my dev.to account. Any idea how can I disconnect this Twitter account and connect another one?
Hello there!
Published: 2017-10-11 08:41:06

---
title: Hello there!
published: true
description: Self introduction
tags: 
---

Usually I try to help companies, or rather people at companies, to improve their engineering practices. Some places need help to streamline their version control practices, start writing automated test. At one point they get ready for Continuous Integration and sometimes even for Continuous Deployment.

For fun I maintain several web sites. On the [Code Maven](https://code-maven.com/) site I write about, well programming and related subjects. I also wrote this [Perl Tutorial](https://perlmaven.com/perl-tutorial). Recently I've started to write and publish books at [Leanpub](https://leanpub.com/u/szabgab).

I guess I'll try to see how to include my RSS feeds here.
Introduction to Python unittest
Tags: python, testing
Published: 2017-10-11 11:49:38

---
title: "Introduction to Python unittest"
published: true
tags: #python, #testing
canonical_url: http://code-maven.com/introduction-to-python-unittest
series: python
---

Using [doctest](/doctest-in-python) is nice, but it is not very good for large test suites.

The [unittest](https://docs.python.org/3/library/unittest.html) module is another standard module that provides a much more powerful way to write tests and despite its name it can be used to write integration and acceptance tests just as well as unittests.

Full [Introduction to Python unittest](https://code-maven.com/introduction-to-python-unittest)
A quick guide to creating Google Maps URLs for your applications
Tags: googlemapsapi, googlemaps, urls
Published: 2017-10-11 06:48:00

---
title: A quick guide to creating Google Maps URLs for your applications
published: true
description: 
tags: [Google Maps API, Google Maps, URLs]
---
![](https://thepracticaldev.s3.amazonaws.com/i/7fwzm2a63c4v17u65iti.png)
Having to find directions to an address that is in an app can be quite painful. Not all apps allow copy pasting the text, maybe it’s not in text format but has been added to the image and nobody ever thought about making it a simple selectable screen, there are many reasons why this could be hard.
So it’s us, when developing our applications and websites, that have to think about the users that might find themselves in the same situations as we are, trying to figure out the direction to that freaking coffee shop that everybody talks about but whose website seems to be a static image that does not allow you to select a thing.
And the solution is very easy: just make sure that under your address string you place an `href` tag with a _Google Maps_ URL! It’s easier than you think and it might solve all your users problems.
How to do that? Well simply take the address you want the users to reach and simply create a link in the following form: 
`'https://www.google.com/maps/dir/?api=1&destination=' . $address`
What this URL will do is simply redirect the user to a Google Maps page showing directions from their current location to the address stored in the variable `$address` or, if they are on mobile, launch the Google Maps app which will then navigate their user from their current location to the address you specified.
Note that you are not limited to simply the address! You can use almost every query you can perform on Google Maps as `destination` value: make it Latitude and Longitude, postcode or whatever other value you prefer, and your users will be able to reach their destination without having to struggle with copying and pasting addresses!

P.S. Remember to encode ([`urlencode()`](http://php.net/manual/en/function.urlencode.php)) the address before appending it to the Google Maps api base URL!

P.P.S. Concatenation and variable syntax here is PHP but the concept is valid for every programming language ;)
Yield in PHPUnit data providers
Tags: cleancode, php, generators
Published: 2017-10-11 03:09:10

---
title: Yield in PHPUnit data providers
published: true
description: Generators allow simplification of some data providers
tags: CleanCode, PHP, Generators
canonical_url: https://www.entropywins.wtf/blog/2017/10/09/yield-in-phpunit-data-providers/
---

Initially I started creating a general post about [PHP Generators](https://secure.php.net/manual/en/language.generators.syntax.php), a feature introduced in PHP 5.5. However since I keep failing to come up with good examples for some cool ways to use Generators, I decided to do this mini post focusing on one such cool usage.

## PHPUnit data providers

A commonly used [PHPUnit](http://phpunit.de/) feature is [data providers](https://phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers). In a data provider you specify a list of argument lists, and the test methods that use the data provider get called once for each argument list.

Often data providers are created with an array variable in which the argument lists get stuffed. Example (including poor naming):


```php
/**
 * @dataProvider provideUserInfo
 */
function testSomeStuff( string $userName, int $userAge ) {}
 
function provideUserInfo() {
    $return = [];
 
    $return[] = [ 'Such Name', 42 ];
    $return[] = [ 'Very Name', 23 ];
    $return['Named parameter set'] = [ 'So Name', 1337 ];
 
    return $return;
}
```

The not so nice thing here is that you have a variable (explicit state) and you modify it (mutable state). A more functional approach is to just return an array that holds the argument lists directly. However if your argument list creation is more complex than in this example, requiring state, this might not work. And when such state is required, you end up with more complexity and a higher chance that the `$return` variable will bite you.

## Using yield

What you might not have realized is that data providers do not need to return an array. They need to return an `iterable`, so they can also return an `Iterator`, and by extension, a `Generator`. This means you can write the above data provider as follows:

```php
function provideUserInfo() {
    yield [ 'Such Name', 42 ];
    yield [ 'Very Name', 23 ];
    yield 'Named parameter set' => [ 'So Name', 1337 ];
}
```

No explicit state to be seen!

Stay tuned for more generator goodness if I can overcome my own *laziness* (hint hint :))

_Originally posted on my [blog](https://www.entropywins.wtf/blog/) as [Yield in PHPUnit data providers](https://www.entropywins.wtf/blog/2017/10/09/yield-in-phpunit-data-providers/)._
Feature Requests on 2017/10
Tags: meta
Published: 2017-10-11 03:03:12

---
title: Feature Requests on 2017/10
published: true
description: 2 features that I think would be cool for dev.to
tags: meta
---

If there was a more proper place to put this, then I'm sorry in advance I made a full post about this but there are two things that I think it would be super cool if dev.to had.

## 1) Top Posts

We already have top tags, but no top posts. Not that I think articles on here should be a competition for reactions by any means, but it would be a nice place to show beginners and new members as a list of examples of articles the community has loved, as well as a place for older members to easily find popular posts.

## 2) Small mobile enhancements

This is actually what inspired this post but anyways, there is no way to view th "Hot Tags" and "Latest discussion threads" sidebars on mobile.
First step in learning new programming language
Tags: coding, python, go
Published: 2017-10-11 02:03:37

---
title: First step in learning new programming language
published: true
description: My non-conventional approach in learning new programming language
tags: coding, python, golang
---

It maybe a coincidence after [writing this](https://metak4ml.blogspot.my/2017/10/the-first-step-in-learning-new.html), I found this write-up by [Beekey Cheung](/pbeekums) on [teaching coding first](https://dev.to/pbeekums/teach-writing-code-first) then the computer science fundamentals.

It seem to align to what I'm thinking too, but I'm putting it at one step above where I don't just start with writing code, but play around with the application built with the language first. This allow me to experience with a lot of cool stuff other than just plain if/else and for loop syntax, coupled with some "Hello world", which easy to get you bored after sometime.

I put here what I wrote on my blog.

########## ###############

The first step in learning new programming language is to prepare the basic environment where you can freely try and experiment with the new language features and tools. Maybe because I'm not programmer type person, but more as tinkerer/builder, I hate learning the language syntax and stuff.

For years after I started "learning" Python, I can't barely write any Python code. But I have manage to try lot of Python cool apps because I have that environment for me to experiment with all Python based applications. All these cool apps that get me hooked to the language, not the syntax or whatever language features. And in my experiences, this is one reason why people failed to get hooked on the new language they want to learn. They started learning with some of the language syntax and eventually get bored, because not so much interesting stuff there. In whatever programming language, it's the ecosystem that made it lively, and where the real work happened.

Early this year, I made it a point to [learn Go](http://k4ml.me/learn-go/) programming language. It's almost a year now and similar to my Python experience I mentioned above, I can't barely write any Go code. But I have [an environment](https://github.com/devkini/notes/wiki/Go) where I can try a lot of Go based applications, and this is the reason I'm still hooked to the language even I haven't manage to write my own code yet. Back with Python experience, I'd only manage to know Python and write Python code after I got my first Python job. That was years after I started learning the language.

The reason this work I think similar to when learning human language. To master the language, you need to practice it. And to practice the language, you need to be in an environment where the language being used. That's it, the environment. So instead of trying to understand the for loop or the class syntax, I spent time to understand how packaging and deployment work, so I can actually run the application for other people to make use of it.

So start to invest your time in having the environment first, whenever you want to learn any new programming language.
I'm planning on creating a website with NodeJS, What can I use to future proof it?
Tags: discuss, webdev, javascript, node
Published: 2017-10-11 01:11:58

---
title: I'm planning on creating a website with NodeJS, What can I use to future proof it?
published: true
tags: discuss, webdev, javascript, node
---

Basically, I'm wondering what technologies, node modules, etc I could use to either future proof it, or just make it easier to make.

My current thought of things to use:
NodeJS 8 - Backend
EJS - Templating
MongoDB - Database

Just posting suggestions is fine, however, I'd appreciate it if you gave examples of how you have or how it can be used and some rough pros and cons of it are. (If you have an opinion that doesn't match everyone else's, I'd still love to hear it)

Thanks <3
What do you talk about during your one-on-one meetings with your engineering (or other) manager?
Tags: discuss
Published: 2017-10-10 21:52:47

---
title: What do you talk about during your one-on-one meetings with your engineering (or other) manager?
published: true
tags: discuss
---

As much as I love chatting with my manager, sometimes I worry that I walk into our weekly one-on-ones woefully underprepared. My question in the discussion title says it all, but here are some related questions that I have about one-on-ones:

What subjects are typically discussed during one-on-ones?

What are your goals going into a one-on-one meeting?

What can I – a new full-time software engineer – do to get the most out of my one-on-ones?

I'd love to hear about any and all of your experiences. Thank you!
ES6 Modules
Tags: es6, javascript, modules, beginners
Published: 2017-11-29 03:47:33

---
title: "ES6 Modules"
published: true
cover_image: https://thepracticaldev.s3.amazonaws.com/i/61mr34y1cg2ywpbhmy8l.jpg
tags: ES6,javascript,modules,beginners
canonical_url: 
---

ES6 modules allows us to have reusable code, in separate files. We do this to eliminate initially massive js files, like `app.js` in a Node and Express project. Modules allow us to spread code over relevant files.

Take this `students.js` file

```javascript
const students = [‘Peter’, ‘Paul’, ‘Mary’];

export const students = [‘Peter’, ‘Paul’, ‘Mary’];
```

Export allows us to export functions, objects, and primitive values into another files.

In `app.js` we import those values as modules into the main js file:

```javascript
import { students } from ‘./students’;
```

…where `./students` represents the file stored in the same directory as `app,js`.

## Importing More than One Value

You can import more than one value from a module. Take `students.js`:

```javascript
export const total = 42;
```

We can import this variable into `app.js` along with the `students` array:

```javascript
import { students, total } from ‘./students’;
```

## Export Data and Functions Between Files

You can export functions _between_ files, such as in this `calc.js` file:

```javascript
const add = (x, y) => {
  return x + y;
}

const divide = (x, y) => {
  return x / y;
}

export { add, divide };
```

To import this module into `app.js`:

```javascript
import { add, divide } from ‘./calc’;
```

Exports are not just limited to primitive data types.

## Export Fallbacks with Default

What if we wanted a function to be the main function for our module?

We can add a `default` keyword to have a fallback:

```javascript
export { add, divide };
export default multiply;
```

This will allow the module to fallback on a function if another fails.

## Watch for this Pitfall

It may be tempting to do something like this:

```javascript
export default const add = (x, y) => {
  return x + y;
}
```

_This will result in a TypeError_.

Why?

The `default` keyword creates a variable called `default`. Adding `default` and `const` simultaneously, JavaScript will try to declare two different variables, which is not allowed in most programming languages.

## More to Come

ES6 is the standard now and so I am learning it, as quickly as possible. Let me know some of your favorite features of ES6.

The post [ES6 Modules](https://tiffanywhite.tech/es6-modules/) appeared first on [Tiffany R. White Blog](https://tiffanywhite.tech).
Building Server Side Rendered Apps with the Angular Universal Starter
Tags: angularuniversal, angular, javascript
Published: 2017-10-10 16:55:09

---
title: Building Server Side Rendered Apps with the Angular Universal Starter
published: true
description: Angular Universal Starter is a minimal starter for quickly getting started with an isomorphic Angular 2+ web application. You can simply clone it from Github and start building your universal Angular app upon it. Lets see how to do that.
tags: angular universal, angular, javascript
---
Angular Universal Starter is a minimal starter for quickly getting started with an isomorphic Angular 2+ web application. You can simply clone it from Github and start building your universal Angular app upon it. Lets see how to do that.

Note:

This post was originallu published in my website: [techiediaries](https://www.techiediaries.com) where you can find more tutorials about new web and mobile technologies from Angular, React to NativeScript and Ionic 2+.

First you need to have Git installed on your system. You need also to have Node.js and NPM installed and configured.

Next clone the Universal Starter from Github with:

    git clone https://github.com/angular/universal-starter.git universal-demo 

Then navigate inside the cloned repo and install the required dependencies with:

    npm install 

After successfully installing all requirements you can start the development server using:

    npm start

After building your application you can create a production bundle using:

    npm run build:prod


## Some notes when using Angular Universal

You shouldn't use the browser specific objects such as window, document, navigator because they only exist on browser environment and since Angular Universal uses a Node.js express server you can't access them.But what you need to do if you need to manipulate the DOM for example?

You should do that only on client side code and make sure to wrap them inside isBrowser function

    import { isBrowser } from 'angular2-universal'   

Make sure to use Angular Renderer class instead of manipulating native elements directly.
Learn Go: Constants with visual examples
Tags: go, programming, tutorial
Published: 2017-10-10 13:37:12

---
title: "Learn Go: Constants with visual examples"
published: true
description: All there is to know about Golang Typed and Untyped Constants.
tags: go, programming, tutorial
---


[![](https://thepracticaldev.s3.amazonaws.com/i/02yognhwhrbr6d8li2tv.png)](https://blog.learngoprogramming.com/learn-golang-typed-untyped-constants-70b4df443b61)


Hi!

ðŸ”¥ [I published a new post](https://blog.learngoprogramming.com/learn-golang-typed-untyped-constants-70b4df443b61)!

**In the post I'm talking about:**

* Benefits of constants
* What is a constant
* Typed constants
* Untyped constants
* Default types
* Ideal types
* High-Precision calculations with untyped constants
* Flexible expressions with untyped constants
* Scopes and Shadowing

Please share this on [twitter](http://tinyurl.com/yd5uxrem).

â†’ [Click to read the article](https://blog.learngoprogramming.com/learn-golang-typed-untyped-constants-70b4df443b61).

----

ðŸ¦ My twitter: [@inancgumus](https://twitter.com/inancgumus).
ðŸ”¥ I’m creating an online course for Go: [Join to my newsletter](http://eepurl.com/c4DMNX).
Die Empty
Tags: productivity, life, mindset
Published: 2018-10-02 10:47:12

---
title: Die Empty
published: true
tags: productivity, life, mindset
canonical_url: http://tedhagos.com/posts/die-empty/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/aubwmrzb0yr3ho58fgys.png
description: digested notes from "die empty" by Todd Henry
---

My takeaways from "Die Empty", a book by Todd Henry;

There are three kinds of work; _mapping_, _meshing_ and _making_.

1. **Mapping** - Prioritizing, planning and setting of objectives
2. **Meshing** - Sharpening the      saw. This is an important determinant of long-term sucess. I'ts difficult      to justify this because it's not tied directly to results
3. **Making** - Performing work      that actually crosses out the items in your todo list. This is "doing      the work". You have a work product. Producing something of value

You need to be purposeful in engaging these three kinds of work. You need to do all three in order to succeed.

![3 kinds of work](https://thepracticaldev.s3.amazonaws.com/i/rxvz8d5id8458qfcisyh.png)


Also, always remember;

* That your days are numbered and finite. Someday they will run out
* Not to get used to comfort. It's good from time to time, but don't make it a way of life
* Plant seeds today for a harvest later
* Your body of work should reflect what's important to you
* Mediocrity doesn't happen suddenly, it develops overtime; you probably got too comfortable, too complacent. You thought nothing would go wrong and you can stay in      " the moment"  forever. This can be a result of current successes being enjoyed e.g. a secured job (that sounded like an oxymoron, no job is ever secure). Look at it this      way, nobody sets out to be mediocre, everybody dreamed and planned for      rock star level success, then life happened
* Define your battles wisely, and build your life around winning them
When do you build a SPA vs. a server-rendered app?
Tags: discuss, webdev
Published: 2017-10-10 11:36:20

---
title: When do you build a SPA vs. a server-rendered app?
published: true
tags: discuss, webdev
---

In a web app I'm working on, we're planning to move the front-end to ReactJS. I'm contemplating whether it'd be better to build it as a SPA (single-page app), where the server just exposes a RESTful API for the frontend to use, or a multi-page app, where the server renders parts of each page that don't need interaction, and we use React for the interactive parts.

What factors would you look into to make a decision like this?
What about performance?
Tags: opensource, github, library, framework
Published: 2017-10-10 11:10:23

---
title: What about performance?
published: true
description: 
tags: open source, github, library, framework
---

Original post https://github.com/onmyway133/blog/issues/85

That's the question I hear often when people are introduced to a new framework. It's a valid concern. But it seems to me that they ask this just for fun. To my surprise, most people just don't care.

Let's me show you https://github.com/thoughtbot/Argo, https://github.com/SwiftyJSON/SwiftyJSON, https://github.com/Mantle/Mantle, ... 

Now take a look back at performance. Here are 2 benchmarks https://github.com/ibireme/YYModel, https://github.com/bwhiteley/JSONShootout

![](https://raw.githubusercontent.com/bwhiteley/JSONShootout/master/images/performance.png)
![](https://camo.githubusercontent.com/73e6774154cfe8652b61f62e8ea32cac48969033/68747470733a2f2f7261772e6769746875622e636f6d2f69626972656d652f59594d6f64656c2f6d61737465722f42656e63686d61726b2f526573756c742e706e67)

***I use it because it has many stars***

Take a look at the stars. I don't say that more stars mean better. I don't believe in stars. Stars may be a result of your marketing effort. The same framework, without any code change, but after featured in some newsletters, gets additional thousand stars. The code remains the same, so what do stars really tell here?

I'm not talking about closed source. I like open source. When deciding an open source framework, there are many factors. It can be issues and pull requests that indicate how the community care about it. It can be good code and good tests, that make it easy to maintain. It can be good documentation, that says how much dedication the developers have put in. 

And here's the fact, when you see a project with many stars, you tend to star it too ðŸ˜‰ for the sake of bookmarking. Stars mean little, but they give us some ideas on how popular a project is.

***I just need to get work done***

OK. Dealing with json is probably one of the most common task in app development. You can choose whatever you like.

***What about performance?***

Honestly, do you really care?
Writing a Netrunner Viewer in Fuse, Part 2
Tags: video, fuse, netrunner, coding
Published: 2017-10-10 05:17:40

---
title: Writing a Netrunner Viewer in Fuse, Part 2
published: true
description: Adjusting the model, adding factions, fighting with the tool
tags: video, fuse, netrunner, coding
cover_image: https://i.imgur.com/q0oMwFW.png
---

Skip the first minute (anybody know how to embed with an offset?).

{% youtube MtN0xnD6OnY %}

I continue building a Netrunner Viewer in this episode. First I migrate to our new data model API, then I fight with fetch for a while, then go on to the seemingly, but not, simple adding of faction logos to the listing.

Along the way I encounter several defects I'll need to follow up on.