teleren/devto huggingface dataset:
Are Ruby and Elixir the Perfect Yin and Yang?
Tags: ruby, elixir, rubyvselixir
Published: 2019-01-31 02:10:56

---
title: Are Ruby and Elixir the Perfect Yin and Yang?
published: true
description: A quick look at Ruby and Elixir and how using both can create a balance.
tags: ruby, elixir, rubyvselixir
cover_image: https://thepracticaldev.s3.amazonaws.com/i/skrwx5yt1p7d9zhqu1an.png
series: ruby vs elixir
---

I’ve been starting to prep for the job hunt the last couple weeks, and you know what that means… **algorithms!**

I’ve been spending around 45 minutes a day working through some of the popular interview questions, and one of the things I've strived to do from the start is look for multiple unique solutions to each problem.

At first, I was just using Ruby because it’s my strongest language. But yesterday I decided to try something different. 

Instead of looking for multiple solutions in just Ruby, I would solve each problem twice. Once in Ruby, and once in Elixir.

**I’ve been doing this for just two days now and I can already tell it was one of the best decisions I ever made!**

For those of you who don’t know, Ruby and Elixir are two languages that are aesthetically very similar, but behave completely differently behind the scenes. 

**Ruby** is an **object-oriented** language at heart and relies heavily on **iteration** and **mutation** to solve problems

**Elixir** is a **functional** language that relies on **recursion** and **pattern matching**.

Using both to solve problems everyday has forced me to look at the same problem from two completely different perspectives, and use two totally different sets of tools to solve it. 

In the long run, **I think doing this will make me a more multidimensional developer**, which I think is one of the key skills that separates the beginners from the pros.

Anyways, this got me thinking a lot about the whole Ruby / Elixir ecosystem and the crossover between the two, and I realized that **the two are almost the perfect yin and yang**. 

Polar opposites in how they operate but with a lot of similarities and a strong relationship. Where one is weak the other is strong, and if you can master both you become a much stronger developer.

What do you guys think… Are Ruby and Elixir the perfect yin and yang?

Are there any other two languages out there that fit the mould?
I'm writing Practices of the Python Pro
Tags: python, discuss, beginners, showdev
Published: 2019-01-31 01:48:25

---
title: I'm writing Practices of the Python Pro
published: true
description: "Introducing Practices of the Python Pro, a new book about software development principles and best practices in the context of one of the most popular programming languages."
tags: python,discuss,beginners,showdev
---

I'm doing a thing.

[![Practices of the Python Pro banner](https://thepracticaldev.s3.amazonaws.com/i/jse6n7cvh22o8f1172wh.png)](https://thepythonpro.com)

I'm pretty stoked to announce that the book I've been working on for the past few months, [_Practices of the Python Pro_](https://thepythonpro.com), is now available for early access! **The first chapter is available for free**, and the first three chapters are currently available if you choose to order the book! I'm able to offer everyone 50% off until February 7th by using the code `mlhillard` at checkout (please let me know if you have any issues at all).

I'm brand new to writing books, so even though I'm teaching others it's been a huge learning process for me as well. I've been writing blog posts and documentation for a while now, but taking someone on a journey through any concept from start to finish is an undertaking! It's certainly the most I've had to think about grammar for about a decade 😄

The review and editing process has been paramount in helping me teach better. Turning around the edits on a chapter is often the most difficult part of writing, but it's resulted in what I hope is a great teaching pace. My goal with this book is to make concepts used every day by experienced software developers  accessible and exciting to those just entering the field, all in the context of Python. I'm covering things like namespacing, separation of concerns, abstraction, testing, and design patterns. Python's popularity means people come into it from all angles, so the book will be a source for anyone looking to take the next step in their software journey!

If you find you're interested enough in the book to [buy it in early access](https://thepythonpro.com) I'm hoping you will help me help others by providing detailed feedback about anything that's confusing, misleading, or missing. The DEV community has been one of the most supportive, inclusive, inquisitive communities I've ever been a part of and I want to produce something that embodies these values!

I'm sure that I will have plenty more to write about the book writing experience as things progress. **I'd love to answer any questions you have; whether about the book, the process, or anything else!**
Gatsby's Default Files and Folders
Tags: gatsby, react, beginners
Published: 2019-01-31 19:28:01

---
title: Gatsby's Default Files and Folders
description: In this video, we walk through each file and folder that comes with a new Gatsby project and talk about what each one is for so you can start customizing your site.
tags: gatsby, react, beginners
canonical_url: https://michaeluloth.com/gatsby-default-files-and-folders/
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/uye7rvoduwyulc97og75.png
series: Up & Running with Gatsby
published: true
---

This is the third video in our [beginner series](https://www.youtube.com/watch?v=jAa1wh5ATm0&list=PLHBEcHVSROXQQhXpNhmiVKKcw72Cc0V-U) exploring GatsbyJS and how to use it to easily build performant apps and websites.

In this video, we walk through each file and folder that comes with a new Gatsby project and talk about what each one is for so you can start customizing your site.

Check out the video below or [view the entire playlist](https://www.youtube.com/watch?v=jAa1wh5ATm0&list=PLHBEcHVSROXQQhXpNhmiVKKcw72Cc0V-U) on YouTube.

Enjoy! 🎉📺

{% youtube o06e7TIJR9Y %}
Understanding states in ReactJS
Tags: react, state, javascript
Published: 2019-01-30 23:10:49

---
title: Understanding states in ReactJS
published: true
description: A beginners guide to understanding the state of a component and how to manipulate it.
tags: ReactJS,react,state,JavaScript,js
---
Hi there - this is my first post and it's aimed at beginners to get an insight into the states in components.

In ReactJS it's very useful to use the state in a component.

We would first declare and initiate our state in our _constructor_ e.g;

```js
constructor() {
    
    this.state = ({ Manipulated: false });
}
```

If we had a further function or piece of code that needed to *alter* or *update* the state of a component then we would use the _setState_ e.g;

```js
componentWillReceiveProps(NewProps) {
    
    var MyBool = NewProps.ManipulativeBool;
    this.setState({ Manipulated: MyBool });
}
```

The _setState_ will also trigger a *re-render* of any DOM elements that will be affected by this state variable.

The states in a component then become very useful when we are rendering our content in the render method to determine what to do based on certain criteria like this;

```js
render() {
    
    var Manipulated = this.state.Manipulated;
    
    return (
        {Manipulated === true ? <p>Our state has been manipulated!</p> : <p>Our state is still false</p>}
    );
}
```

In this simple example we will output and render different content based on the state of the Manipulated Boolean we have set up.

If the Boolean is true then only then will it render and allow our content _Our state has been manipulated_ to successfully be rendered and shown. And in other cases it will remain as _Our state is still false_.

This is just an insight into the powerful functionality you can have by using states in ReactJS and hopefully this is a short little trick for people who are just beginning.
DRY — Don’t Repeat Yourself
Tags: dry, rubt, goodpractices, designpatterns
Published: 2019-01-30 22:49:29

---
title: DRY — Don’t Repeat Yourself
published: true
description: 
Good morning, good afternoon, good evening, good night, what they are in common? Yeap, the word “Good”. The concept DRY consists in look this and “dry” your repetitions, after dry could be: Good, morning, afternoon, evening and night...

tags: dry, rubt, good practices, design patterns
cover_image: https://thepracticaldev.s3.amazonaws.com/i/2yeoqfrqx2i95slq3sav.jpeg
---


Good morning, good afternoon, good evening, good night, what they are in common? Yeap, the word “Good”. The concept DRY consists in look this and “dry” your repetitions, after dry could be: Good, morning, afternoon, evening and night. Being thus the word would serve for all, without losing the logic.

Let’s see example in a code:

![Trecho do código antes de aplicar o DRY](https://thepracticaldev.s3.amazonaws.com/i/winqobznflm7il9hny77.png)

![Trecho do código posterior a aplicação do DRY](https://thepracticaldev.s3.amazonaws.com/i/jk12q2fntbgv1agpnm3k.png)

The same logic but in fewer lines of code. That is one of the philosophies about Ruby on Rails best practices, Ruby (and Rails) is fantastic because of this and others practices, Ruby code is totally readable, simple and powerful. And Rails has MVC organization, Tests, Naming Convention making a clean code, also has Convention Over Configuration and others things. So that’s it, let’s study and code.

“Know, understand, modify and create.”
Protect your local data with BitLocker
Published: 2020-01-12 20:12:46

---
title: Protect your local data with BitLocker
published: true
date: 2019-01-30 21:36:14 UTC
tags: 
canonical_url: https://christophweigert.com/protect-your-local-data-with-bitlocker/
---

 ![Protect your local data with BitLocker](https://christophweigert.com/content/images/2019/01/night-computer-hdd-hard-drive.jpg)

BitLocker is a feature embedded since Windows Vista that allows you to encrypt your hard disk. You should enable this feature to prevent unauthorized access to your private data in case your laptop or computer gets stolen. Another advantage is the integration with TPM (Trusted Platform Module) which validates the integrity of your boot and system files before decrypting your data.

## Requirements to use BitLocker

BitLocker is only available for:

- Computers with TPM 1.2 or later (Or use an external Drive to store the startup key)
- Supported BIOS / UEFI 
- Boot drive with NTFS file system
- System drive with FAT32 (UEFI) or NTFS (BIOS) file system

## Setup BitLocker

![Protect your local data with BitLocker](https://christophweigert.com/content/images/2018/12/image.png)<figcaption>Open the Windows start menu and start typing BitLocker</figcaption>

![Protect your local data with BitLocker](https://christophweigert.com/content/images/2018/12/image-1.png)<figcaption>Click on the UAC Icon "Turn on BitLocker"</figcaption>

If your device is not supported, you will see the following message.

![Protect your local data with BitLocker](https://christophweigert.com/content/images/2018/12/image-2.png)

If that's the case, you can buy a TPM Module I, for example, use the following Asus TPM Module, but be aware that your mainboard must have a TPM header.

![Protect your local data with BitLocker](https://christophweigert.com/content/images/2019/01/asus_tpm-m_r2.0.jpg)<figcaption><a href="https://amzn.to/2BawYXK">ASUS Computer TPM-M R2.0</a> from Amazon</figcaption>

After installing the module open again the Settings Dialog and follow the instructions after clicking "Turn on BitLocker".

If you have any questions, hit me up in the comment section.
Build bundle.js in create-react-app application
Tags: react, webpack, build, javascript
Published: 2019-01-30 21:08:13

---
title: Build bundle.js in create-react-app application
published: true
description: 
tags: #react #webpack #build #javascript
---

Made a project. Now we need to collect everything in one bundle.js, and not in the way create-react-app does.
Executed the eject command, configs appeared. But how do i get bundle.js?
It is important that everything that is in the project (styles, pictures, etc.) be gathered into one file.
Buildless Vuejs
Tags: vue, buildless, static
Published: 2019-01-30 20:21:15

---
title: Buildless Vuejs
published: true
description: One way you could write vuejs without a build step
tags: vuejs,buildless,static
cover_image: https://thepracticaldev.s3.amazonaws.com/i/nfj2e2rnxh3vecdxru6h.png
---

# The Slide

This isn't a, "this is how you should do it", post.  This more like how you could do it and works well for something like an internal dashboard.  I started with this strategy because I figured it would help my coworkers be able to jump right into the source code.  The only requirement to run locally or in production is an HTTP server.  This makes deployment very easy.  Copy files to the server.

## 1x Magnification

- [requirejs](https://requirejs.org/)
- [require-vuejs](https://github.com/edgardleal/require-vuejs)

These 2 libraries make it all work.  A side benefit to this approach is you get configurable code splitting.

```
.
├── [page-name]
│   └── index.html
├── css
│   └── app.css
├── favicon.ico
├── index.html
└── js
    ├── [page-name].js (each page gets a js file)
    ├── bootstrap.js (configure requirejs & global functions)
    ├── components
    │   ├── [page-name]
    │   │   └── page-component.vue
    │   └── global-component.js
    ├── library(s).js
    └── pages
        └── [page-name]
            ├── page1.vue
            └── page2.vue
```

Every `index.html` file gets 3 things to work.

1. `require.js` - library which will load required files dynamically
2. `bootstrap.js` - configurations for require.js and global utilities
3. `[page-name].js` - page specific requires, initial state, Vue component mounting, and anything else you need for the page

## 10x Magnification

```js
// [page-name].js
require([
  "Vue"
  // library(s).js,
  
  // components/global-component.js,
  
  // components/[page-name]/page-component.js,
], function(Vue/*, library(s)*/) {
  new Vue({
    el: '#app',
    data: window.data
  });
});
```

In the above snippet, `require([<stuff>,` is where the "code splitting" happens.  Of course everything in that array will be a network request.  Another very nice benefit is that you don't have to register your vue components!  The last benefit I found is that the `.vue` files are easily readable in devtools.

### 100x Magnification

In my setup I went the lazy route and use a global state object (`window.data`) to control the vuejs data.  This approach can be tricky to understand when js will observe a change.  But if I'd like to mock a state, it is pretty pleasant just modifying that object in the console.

For reference:

{% github kyleparisi/buildless-vuejs %}
Ketting 2.5 release
Tags: hateoas, rest, jsonapi, typescript
Published: 2019-01-30 20:19:19

---
title: Ketting 2.5 release
published: true
tags: hateoas, rest, jsonapi, typescript
canonical: https://evertpot.com/ketting-2-5/
---

[Ketting][1] is an attempt at making a generic Hypermedia API client for javascript. It uses a 'link' and following links as the most important primitive.

Last week I released version 2.5.0 on [NPM][2] so maybe it's time to list some of the improvements since the [last update][3] in order from most to least interesting.

JSON:API support
----------------

[JSON:API][4] is a standard for making JSON-based APIs, and it has some support for hypermedia ideas as well.

In particular, the standard has a `links` object, and it also defines a relationship between collections and members of collections.

This release now ships with a 'representor' for JSON API, which means you can now do something like this:

```javascript
const myResource = await home
  .follow('next') // This might be a HTML5 document
  .follow('author') // This might be a HAL document
  .follow('about') // This might be a JSON:API document
```

All of these will now be seamless regardless of which format any of these hops used, only when you `get()` and `put()` the format is relevant again.

A lot of help in getting this right came from JSON:API community members such as Gabe Sullice and Ethan Resnick. If you're interested in the full discussion about how JSON:API maps to HATEOAS read [the Github issue][5].

`go()` function
---------------

Not every endpoint will have every appropriate link to another resource. Sometimes you just have to work with what you have, and fetch a resource yourself.

The `go()` function is a function that exists on a resource and simply gives you a new resource based on the url you passed. The url can be relative and will be resolved based on the 'current' resource.

```javascript
const anotherResource = resource.go('?q=hello');
```

Resource is generic
-------------------

If you use typescript with this package, it might be desirable to have some typing.

Adding good support for this will be an ongoing process, but as a first step the `Resource` class is now generic.

This means that you can define a function such as:

```typescript
function foo(): Resource<MyBodyType> {
  // ...
}
```

Typescript will then use `MyBodyType` as the type that will be returned from `get()` and `refresh()` and will demand that the value passed to `put()` has this type.

By default this is `any`.

I think this is a decent first step, but I also imagine this will have to continue to evolve.

esModuleInterop is false
------------------------

The Typescript build now has `esModuleInterop` off. Apparently keeping it set to `true` caused anyone who uses the library and has this setting set to `false` to get errors.

So in order to not force people to change this setting, `esModuleInterop` is now off, which means the library will work regardless of your own preference.

[1]: https://github.com/evert/ketting
[2]: https://www.npmjs.com/package/ketting
[3]: /ketting-2-3/
[4]: https://jsonapi.org/
[5]: https://github.com/evert/ketting/issues/109
Heading to SouthEast Dreamin’ ’19
Tags: southeastdreamin, salesforce, lwc
Published: 2019-02-04 15:50:21

---
title: Heading to SouthEast Dreamin’ ’19
published: true
tags: Southeast Dreamin, Salesforce, LWC
canonical_url: https://wipdeveloper.com/heading-to-southeast-dreamin-19/
cover_image: https://wipdeveloper.com/wp-content/uploads/2019/02/SED-Web-Logo-e1453762337688.png
---

Hello! In March the Southeast Dreamin’ 19 event will be taking place in Atlanta Georgia March 21- 22, 2019. I will be presenting “A Quick Intro to Lightning Web Components”.

## Southeast Dreamin’

For more information about [Southeast Dreamin’](http://www.southeastdreamin.com/) and to [register](http://www.southeastdreamin.com/#tile_registration) you should visit their [site](http://www.southeastdreamin.com/). Bellow is a copy from the [About Us](http://www.southeastdreamin.com/about-us-2/) page **What is Southeast Dreamin’?** section.

> _Southeast Dreamin’ was created by Salesforce users for Salesforce users, to provide learning and networking opportunities as well as facilitate collaboration._  
> _It is a one & a half day event that features a Keynote speaker, over 20 community-led breakout sessions and Hands on Training (HOT) sessions. You will also have access to a Sponsor Expo and live Demo Jam to learn about AppExchange options that can expand your use of Salesforce._

## A Quick Intro to Lightning Web Components

![](https://i1.wp.com/wipdeveloper.com/wp-content/uploads/2019/02/AQuickIntrotoLightningWebComponents.png?w=1100&ssl=1)<figcaption>They made a neat banner image!</figcaption>

_Lighting Web Components are the new, standards based way to create UI elements for Lighting. We will take a quick look at the tools needed to get started and the basics of creating a Lighting Web Component._

Hope to see you there!

## That’s it for now.

Remember to sign up for **[The Weekly Stand-Up!](https://wipdeveloper.com/newsletter/)**  and you can get updated with any new information we have on WIPDeveloper.com.

The post [Heading to SouthEast Dreamin’ ’19](https://wipdeveloper.com/heading-to-southeast-dreamin-19/) appeared first on [WIPDeveloper.com](https://wipdeveloper.com).
Godoc like CLI tool for nodejs documentation. 
Tags: go, node, cli, tool
Published: 2019-01-30 19:10:55

---
title: Godoc like CLI tool for nodejs documentation. 
published: true
description: 
tags: Go,Nodejs,CLI,Tool
---


Hello there,
Here is a tool for nodejs documentation. [https://github.com/AnikHasibul/jsdoc](https://github.com/AnikHasibul/jsdoc)

![Image from https://www.conetix.com.au/blog/a-closer-look-at-go-and-nodejs](https://thepracticaldev.s3.amazonaws.com/i/izqmebdkue5xftpgoevr.jpg)

We all know that, how hard it is to find out methods and functions of a nodejs module. 
And we also know how easy it is in [Golang](https://golang.org). It's as simple as `go doc fmt`

But as other devs I always try to dump (`console.log`) an object to know a bit about the object. And [jsdoc](https://github.com/AnikHasibul/jsdoc) does the same thing! ;)

So here is few examples of jsdoc:

Listing objects from `console` module.

```
$ jsdoc console
Console {
  log: [Function: bound consoleCall],
  debug: [Function: bound consoleCall],
  info: [Function: bound consoleCall],
  dirxml: [Function: bound consoleCall],
  warn: [Function: bound consoleCall],
  error: [Function: bound consoleCall],
  dir: [Function: bound consoleCall],
  time: [Function: bound consoleCall],
  timeEnd: [Function: bound consoleCall],
  timeLog: [Function: bound timeLog],
  trace: [Function: bound consoleCall],
  assert: [Function: bound consoleCall],
  clear: [Function: bound consoleCall],
  count: [Function: bound consoleCall],
  countReset: [Function: bound consoleCall],
  group: [Function: bound consoleCall],
  groupCollapsed: [Function: bound consoleCall],
  groupEnd: [Function: bound consoleCall],
  table: [Function: bound consoleCall],
  Console: [Function: Console],
  profile: [Function: profile],
  profileEnd: [Function: profileEnd],
  timeStamp: [Function: timeStamp],
  context: [Function: context],
  [Symbol(kBindStreamsEager)]: [Function: bound ],
  [Symbol(kBindStreamsLazy)]: [Function: bound ],
  [Symbol(kBindProperties)]: [Function: bound ],
  [Symbol(kWriteToConsole)]: [Function: bound ],
  [Symbol(kGetInspectOptions)]: [Function: bound ],
  [Symbol(kFormatForStdout)]: [Function: bound ],
  [Symbol(kFormatForStderr)]: [Function: bound ],
  [Symbol(counts)]: Map {},
  [Symbol(kColorMode)]: 'auto',
  [Symbol(kIsConsole)]: true,
  [Symbol(kGroupIndent)]: '' }
```

Listing items from `http` package's `METHODS` array:

```
$ jsdoc http.METHODS
[ 'ACL',
  'BIND',
  'CHECKOUT',
  'CONNECT',
  'COPY',
  'DELETE',
  'GET',
  'HEAD',
  'LINK',
  'LOCK',
  'M-SEARCH',
  'MERGE',
  'MKACTIVITY',
  'MKCALENDAR',
  'MKCOL',
  'MOVE',
  'NOTIFY',
  'OPTIONS',
  'PATCH',
  'POST',
  'PROPFIND',
  'PROPPATCH',
  'PURGE',
  'PUT',
  'REBIND',
  'REPORT',
  'SEARCH',
  'SOURCE',
  'SUBSCRIBE',
  'TRACE',
  'UNBIND',
  'UNLINK',
  'UNLOCK',
  'UNSUBSCRIBE' ]
```

I hope you got the concept about `jsdoc` tool.

You can download the tool for yourself and put a star on the repo at [https://github.com/AnikHasibul/jsdoc](https://github.com/AnikHasibul/jsdoc)

Thank you!
photoEditor
Tags: imageeditor, canvas, javascript, imageprocessing
Published: 2019-01-30 18:58:37

---
title: photoEditor
published: true
description: A image editor usign JavaScript Canvas
tags: image-editor, canvas, javascript, image-processing
canonical_url: https://github.com/victorqribeiro/photoEditor
cover_image: https://thepracticaldev.s3.amazonaws.com/i/31njnmua9a3slne5o7kf.png
---

# photoEditor

A image editor made using JavaScript canvas.

![screenshot](https://thepracticaldev.s3.amazonaws.com/i/31njnmua9a3slne5o7kf.png)

An online version is hosted [here](https://victorribeiro.com/photoEditor)

# About

This is a ongoing project that started after I decided to implement some image processing algorithms I've learned along the way.

It's not fully optimized and needs some improvment, but as I said, it's a ongoing project.

# To Do

- Undo button
- Better GUI - A toolbar 
- ??? (sugestions)


You can check out the code [here](https://github.com/victorqribeiro/photoEditor)