teleren/devto huggingface dataset:
Rydux - A Redux store for your ruby application
Tags: showdev, ruby
Published: 2018-06-27 15:04:21

---
title: Rydux - A Redux store for your ruby application
published: true
description: 
tags: #showdev #ruby
---

Hey all, just wanted to write this post to let you know about a small ruby gem I've created, Rydux. This gem allows you to decouple the state from your logic in your application, and implements a more functional paradigm to ruby programming. You can check it out [here](https://www.github.com/alexdovzhanyn/rydux).


To use the gem, require it somewhere in the _root_ of your application (or somewhere the store will be accessible everywhere you need it). Next, create some reducers in your application, you can place them anywhere, but a `reducers/` directory is recommended. A sample reducer looks something like this:

  ```ruby
  # reducers/user_reducer.rb

  class UserReducer < Rydux::Reducer

    # Your reducer MUST have a map_state function in order to do anything.
    def self.map_state(action, state = {})
      case action[:type]
      when 'SOME_RANDOM_ACTION' # You can add as many actions here as you'd like
        state.merge(some_random_data: true)
      when 'APPEND_PAYLOAD'
        state.merge(action[:payload])
      else
        state
      end
    end

  end

  ```

Create a store somewhere easily accessible in your application:
  ```ruby
    require 'reducers/user_reducer'

    # The key passed into .new here is the key at which this value
    # will be stored in the state. E.g. { user: whatever_user_state }
    Store = Rydux::Store.new(user: UserReducer)

  ```
Have something subscribe to the store:
  ```ruby
    class MyClass
      def initialize
        Store.subscribe(self)
      end

      # Every instance that subscribes to the store will
      # get this state_changed method called whenever the state
      # in the store changes. Do whatever you want with your state here.
      def state_changed(state)
        # ...
      end
    end
  ```
To update the store with new data, you can `dispatch` actions, like so:
  ```ruby
    Store.dispatch(type: 'SOME_RANDOM_ACTION')
  ```

### Putting it all together:

```ruby
require 'rydux'

class UserReducer < Rydux::Reducer
  @@initial_state = { name: 'Alex', age: 20 }

  def self.map_state(action, state = @@initial_state)
    case action[:type]
    when 'CHANGE_USER_NAME'
      state.merge(name: action[:payload][:name])
    else
      state
    end
  end

end

Store = Rydux::Store.new(user: UserReducer)

class Friend
  def initialize
    Store.subscribe(self)
    @users_name = Store.state.user.name
  end

  def state_changed(state)
    @users_name = state.user.name
  end

  def greet_user
    puts "Hello, #{@users_name}"
  end
end

# Create a new friend (this will subscribe it to the store)
friend = Friend.new
friend.greet_user #=> Hello, Alex

# Change a value in the store
Store.dispatch(type: 'CHANGE_USER_NAME', payload: { name: 'Mike' })
friend.greet_user #=> Hello, Mike
```
Finding motivation
Tags: video, mindset
Published: 2018-06-27 04:32:19

---
title: Finding motivation
tags: video, mindset
canonical_url: https://zellwk.com/blog/finding-motivation
description: Don't feel like working? Don't have enough motivation? Maybe motivation isn't the problem. Maybe you just need a system. Here's my system.
published: true
---

{% youtube tlEB85OXuUU %}

Many people rather relax than work.

They say they don't feel motivated to work. They need to feel motivated.

Sounds familiar?

<!-- more -->

## You don't need motivation

You already have the motivation. That's why you want to work in the first place. That's why you feel guilty if you don't work.

You don't lack motivation.

The problem isn't with motivation.

The problem is you didn't act on your motivation.

You let your resistances stop you.

## You need a system

In Turning Pro, Steven Pressfield talks about how professionals show up and do the work every day.

They show up when they don't feel like it. They still show up when they're tired.

They start work at the same time every day. And they don't stop until they accomplished what they set out for.

You need a system like that.

You need to create an environment where you can work. Set a start time. Set an end time. Don't let anything distract you between the times.

Keep doing it and you'll form a habit. When you form the habit, it becomes much easier for you to maintain the system.

## Decide what you're going to do in advance

If you want to learn JavaScript, you don't put "I want to learn JavaScript" as the task because JavaScript is too broad.

You can narrow things down and say "I'm going to focus on functions today". The next day, you can say "I want to learn For loops", and so on.

Break the large tasks into small tasks the night before (or the week before).

## Recharge before your session

Work requires energy.

You owe it to yourself to recharge.

Different people recharge differently. I usually meditate, take a nap, or shower.

Find out what works for you and do it before your session.

<hr>

Thanks for reading. This article was originally posted on [my blog](https://zellwk.com/blog/finding-motivation). Sign up for [my newsletter](https://zellwk.com) if you want more articles to help you become a better frontend developer.
I am Facebook Developer Circles Lagos: Community Manager and also Open Source Africa: Co-organizer, Ask Me Anything!
Tags: ama
Published: 2018-06-27 14:06:33

---
title: I am Facebook Developer Circles Lagos: Community Manager and also Open Source Africa: Co-organizer, Ask Me Anything!
published: true
tags: ama
---
I am also a fullstack javascript Developer, Blockchain Enthusiast
Cereal Man, Code worksheet # 3
Tags: javascript, webdev, beginners
Published: 2018-06-27 13:33:36

---
title: Cereal Man, Code worksheet # 3
published: true
description: For loops 
tags: JavaScript, web development, beginners, 
---

<img src="https://thepracticaldev.s3.amazonaws.com/i/qtvkpvoc9rftcylqjtx8.png"> 

This is the 3rd code worksheet in a series of: "As long as they work and I'm getting results". 

This worksheet features For Loops. While coding is a pretty hands on activity, reading is probably the most under-rated part of coding! Which is part of what I'm trying to do here with the worksheets, present bite sized information for scrumptious and easier consumption to the mind. It's like eating a vanilla sprinkles donut flavored protein bar. 

As usual suggestions,edits, comments are welcome. I usually make these between 12-2 am just in case you're wondering why my sense of humor is what it is..

Here: https://codepen.io/Kauress/full/WyaQBM/

ps -  formatting a bit weird in the embed here

{% codepen https://codepen.io//Kauress/pen/WyaQBM %}
Digging Deeper
Tags: cpp, beginners, discuss
Published: 2018-06-27 12:04:25

---
title: Digging Deeper
published: true
description: Understanding the core of things
tags: cpp,beginner,discuss
---

I have a habit of starting a course/project and become very curious about a certain topic. Go off on a tangent trying to understand some lower-level topic. Does this happen to anyone else?  Mostly beginners/noobs? Or do senior developers suffer from this?
The 4 characteristics of a blockchain
Tags: blockchain
Published: 2018-06-27 11:34:31

---
title: The 4 characteristics of a blockchain
published: true
description: Because not everything is a blockchain!
tags: blockchain
---

## Introduction

Lately, Blockchain is one of those terms that get thrown around a lot. As with most  new shiny things, we must educate ourselves to understand why there is so much hype and also where the Blockchain concept might be useful in the future.

One thing we must not confuse is the Blockchain itself and the use cases for Blockchain. Bitcoin and Ethereum ( for example ) are use cases enabled by the emergence of the Blockchain concept. Think of a Blockchain as an operating system like MacOS or Windows. Bitcoin is just an application running on that operating system. In the case of Bitcoin, the Blockchain is a mean to store and record Bitcoin transactions.

But, not everything that can record and store transactions is labelled *Blockchain*. A blockchain network has 4 key characteristics:

## Consensus

For a transaction to be accepted and recorded on the blockchain, all the participants must agree to follow the same rules. This is the **consensus**. If a transaction violates one of the rules the network agreed on, the transaction will be considered invalid. The consensus allows each participant to trust the network, because they know each transaction will follow rules they ratified when the network launched.

## Provenance

Participants know where the assets came from and how its ownership has changed over time. Each asset's ( whatever it is, tangible, intangible, digital ) provenance must be tracable. If we have a blockchain designed to track a fish's journey from the sea to a restaurant, I must be able to know where it was caught, by who, and when. I also must be able to know how many middlemen were involved during the fish's journey. All the way to the moment the restaurant bought my fish.

## Immutability

No participant can modified a transaction after it has been recorded on the ledger. Doesn't matter who you are, you just do not have the power to do that. If an error occurs, a new transaction must be used to reverse the error. At that point, both transactions will be visible on the ledger. The first transaction, considered an error, will always be visible once it is recorded.

## Finality

In a blockchain network, there is only one source of *truth*. There is only one ledger for the whole network. To know who owns what, or to study a particular transaction, there is only one place to go. 


## Conclusion

This was a short article to quickly explain some of the characteristics a network must have to be labelled a blockchain. Not every network is a blockchain, nor every network *can* become a blockchain. Hope it was clear enough! Have fun!
OpenShift for Mere Mortals: Getting Started With the OpenShift UI
Tags: openshift, docker, containers, kubernetes
Published: 2018-06-27 03:21:42

---
title: OpenShift for Mere Mortals: Getting Started With the OpenShift UI
published: true
description: the next entry in the series talking about the OpenShift UI
tags: openshift, docker, containers, kubernetes
cover_image: https://thepracticaldev.s3.amazonaws.com/i/qufb5t7f22v5909qvofc.png
---

I've added a new entry in the **OpenShift For Mere Mortals** series, this time introducing the **OpenShift UI**. I walk through building a simple application and demonstrate how easy it is to get started. 

https://vault.osninja.net/openshift-for-mere-mortals-part-seven/
Need advice on how to start my career!?
Tags: discuss, career
Published: 2018-06-27 01:02:34

---
title: Need advice on how to start my career!?
published: true
description: 
tags: #discuss #career
---
    




I am about to get my Associates in Computer Science. My wife is in the military so we travel quite often.I usually have to retake a few classes because not all my courses gets transferred over very well.

   We move about every 2 or 3 years and its only been delaying the time it would take to graduate. I was thinking about getting my degree from an online college like <i>Colorado Technical University</i> or <i>Southern New Hampshire University online.</i>

<b>So my question is what do employers think of online colleges?</b> Has anyone had any experience trying to get hired with this kind of degree? Is it even worth considering or is it better to wait a little longer for the traditional degree?
Confidence is a Key Metric
Tags: devops, webdev, beginners
Published: 2019-04-09 22:26:10

---
title: Confidence is a Key Metric
published: true
tags: devops, webdev, beginners
canonical_url: 
---

Whether you’re the CTO, an engineering manager, a team lead, or an individual contributor; when you’re building and developing systems and process, whether for release or otherwise, a key metric to keep in mind is confidence.

What does that mean? That means that you need to build a system that is trusted. For example a CI system that let through every build wouldn’t be very confidence inspiring, even if some users might see that as “broken,” how could you ever trust the system to catch your mistakes or to keep your product from going off the rails?

What happens to systems that don’t inspire confidence? Eventually, nothing. That’s the problem with systems that don’t instill confidence; more often than not, their use will decline until they’re not used at all.

> In the absence of a trusted process, individuals will seek to replace that system with something they can be more confident in.

These are often “hope driven” systems.

Hope driven systems are usually less productive, like manually checking and rechecking the commits in a release, or reading and rereading a patch and _hoping_ a potential bug will jump out the 5th time that didn’t pop up on the 4th (or 3rd, or 2nd). Or with lack of confidence in a result (say a test run or pipeline flow), retrying with the hope that the result will be different or more revealing.

Does this mean double checking things are bad? No, not at all. Simply that ad hoc “security blanket” type systems that replace humans with computers instead of the reverse for things computers are good at like checking tests and confirming outcomes is usually inefficient.

Certainly more inefficient than rolling out to a single box in prod and giving 1% of traffic for example. Something that a system may make possible in a matter of minutes as opposed to the hours or even days that panicked reading and rereading takes.

> If your system isn’t producing confidence, then its likely being subverted or causing time to be wasted.

They should produce more than the end result. They should produce knowledge _and_ confidence in the process itself and in the operators’ skill along the way. It doesn’t have to be a lot at once. I’m not saying that someone should run through a checklist or other process once and feel like they’ve mastered it, but over time this should be noticeable effect.

Here are some things that erode confidence:

- Intermittent outcomes
- Random failures
- Unreliability.

Things that instill and improve confidence:

- Accurate, helpful error messages
- Date of last accuracy check

Note that not all of these need be applied in all situations.

What processes or systems do you have in place on your team that build or destroy confidence?


What do you think? Leave a comment here. For more like this see here: https://thaiwood.io/DevTo
Learning the position CSS property for good
Tags: css, devtips, beginners, explainlikeimfive
Published: 2018-08-01 02:57:43

---
title: Learning the position CSS property for good
published: true
tags: css,devtips,beginners,explainlikeimfive
cover_image: https://winnercrespo.com/assets/images/2018-6-27-learning-the-position-css-property-for-good.jpeg
canonical_url: https://winnercrespo.com/learning-the-position-css-property-for-good/
---

When I create a layout from scratch, I find myself adding different values to the `position` CSS property and to the DPP (direction position properties, I just made that acronym up) top, right, bottom and left properties, hoping that magically they will look as I expect. Maybe you do too.

It would probably be better to learn what they do for good, so we know how to use them.

First of all, a positioned element is one that has a different value than `position: static`, which is the default. In other words, an element that has `position` set as `relative`, `absolute`, `fixed` or `sticky`.

Having that said, we can state that `position` defines how an element is positioned on the page. On the other hand, the DPP add an offset on the direction they specify.

Let’s see how each one works.

## `static`

This is the default value and means that the element will be placed according to the page flow. Because of that, the DPP don’t affect it.

## `relative`

The element will also be placed according to the page flow but now you can use the DPP to add an offset relative to itself. As we can see in the animation below, the space this element is supposed to use is reserved and other elements are not affected even after adding an offset.

{% codepen https://codepen.io/wistcc/pen/mjXgjq %}

## `absolute`

You can use this value to place an element exactly where you want it, also, the element is removed from the page flow. This position will be relative to the next parent element with `relative` or `absolute` positioning. If there is no such parent, it will be placed relative to the page itself as the next example.

{% codepen https://codepen.io/wistcc/pen/BPYEOV %}

## `fixed`

The element is positioned relative to the viewport since the viewport doesn’t change when scrolling, the element will be fixed exactly where you placed it. Also, just like `absolute`, the element is removed from the page flow and it will be relative to the next parent element with `relative` or `absolute` positioning.

{% codepen https://codepen.io/wistcc/pen/EpQJdP %}

## `sticky`

It behaves like the `fixed` value but relative to itself since the element is placed according to the page flow. In the example, we can notice that once we are able to see the element and we keep scrolling it will be fixed.

{% codepen https://codepen.io/wistcc/pen/bjLJmm %}

I hope that now you are able to use those properties knowing exactly what they do.

Happy coding.
Hack of The Day: 👷‍♂️🛠Build a Serverless SMS Crypto Price 💸Checker With Messagebird and StdLib 😍🤓
Tags: javascript, node, crypto, microservices
Published: 2018-06-26 23:57:49

---
title: Hack of The Day: 👷‍♂️🛠Build a Serverless SMS Crypto Price 💸Checker With Messagebird and StdLib 😍🤓
published: True
description: 🤗👷‍♂️🛠 I built my own SMS cryptocurrency price checker with messagebird and StdLibHQ in under 6 minutes! Now when I text Bitcoin, Ethereum, etc... I get real-time crypto prices! Build yours and get creative with it! 
tags: #Javascript, #nodejs, #crypto, #microservices
---

🤗👷‍♂️🛠 I built my own SMS cryptocurrency price checker with messagebird and StdLibHQ in under 6 minutes! Now when I text Bitcoin, Ethereum, etc... I get real-time crypto prices! Build yours and get creative with it!  

Build yours using this tutorial: 

{https://medium.com/@jacoblee93/build-a-serverless-sms-crypto-price-checker-in-6-minutes-with-messagebird-and-stdlib-a96e826e29aa} 

![Alt text of image](https://pbs.twimg.com/media/DcGLTVAVwAAFZJx.jpg)
Time to abandon pattern name suffixes?
Tags: discuss, programming
Published: 2018-06-26 23:39:50

---
title: Time to abandon pattern name suffixes?
published: true
tags: discuss, programming
---
A talk by Kevlin Henney inspired me to remove the `Exception` suffix from classes in a project I am working on. 

In the context of a checked exception being caught or an unhandled runtime exception, it's pretty clear that it's an exception you're dealing with.

Besides, in that project, all exceptions are in an `exception` package. Pretty easy to guess what's happening.

That got me wondering. It's a pretty common practice to append the name of patterns to class names. `FooFactory`. `BarController`. 

Wouldn't it make more sense to find more concise, speaking names instead?

![Image](https://i.redditmedia.com/tHbmWDAlprYm0RDgHX1EGf7Yhx8KNy20n0HEv8vjD_w.png?s=e902918450214ca15f33bcf0f5e609e0)
Crosspost: The Recompiler Magazine, Issue 8: Build Your Interviewing Strategy
Tags: crosspost, interviewing, carolsmith
Published: 2018-06-29 22:38:47

---
title: Crosspost: The Recompiler Magazine, Issue 8: Build Your Interviewing Strategy
published: true
tags: Crosspost,Interviewing,carol smith,crosspost
canonical_url: http://www.heidiwaterhouse.com/2018/06/26/crosspost-the-recompiler-magazine-issue-8-build-your-interviewing-strategy/
---

I’m a huge fan of The Recompiler, and not just because they sometimes publish my work. I support anyone who spends the time and effort to publish articles that are useful, thoughtful, and frequently action-oriented.

Carol Smith (of OSI board fame) and I put together a workshop for people who are doing technical interviews for the first time. We called it “The Hardest Part of Tech(nical Interviewing) Is People”. We’ve given it a couple times, and we’re hoping to do a recorded version. This article is part of what we talk about in the workshop – how to look over your past experiences, even if they weren’t in technology, and make them relevant and applicable. We hope this helps you!

[Build Your Interviewing Strategy](https://recompilermag.com/issues/issue-8/build-your-interviewing-strategy/)

And in conclusion, support your local publications!

The Recompiler Magazine
🙂 Introducing Front-end Foundations
Tags: html, css, javascript, showdev
Published: 2018-06-26 17:22:39

---
title: 🙂 Introducing Front-end Foundations
published: true
description: A resource and community for developers learning HTML, CSS, & Javascript. Mostly for beginners–but everyone is welcome.
tags: html, css, javascript, showdev
---
{% youtube O6GzqQuDmw4 %}

I am excited to introduce my new side project [frontend-foundations.com](https://frontend-foundations.com).

A resource and community for developers learning HTML, CSS, & Javascript. Mostly for beginners–but everyone is welcome.

Follow along on Twitter: https://twitter.com/fefoundations
View the Github repo: https://github.com/alexcarpenter/frontend-foundations
Build and Authenticate an EmberJS 3 Application
Tags: javascript, ember, emberjs3, webdev
Published: 2018-06-26 16:08:30

---
title: Build and Authenticate an EmberJS 3 Application
published: true
description: Learn how to build and authenticate an EmberJS 3 Single Page Application
tags: #javascript #emberjs #emberjs3 #webdev
canonical_url: https://auth0.com/blog/build-and-authenticate-an-emberjs-3-application/
---

Let's dive into the world of EmberJS, a framework built so that we all can be more productive as developers. Easy to jump in to and easy to get started with, EmberJS is a great framework to know and understand. In this tutorial, we will be building an application using EmberJS 3 and then add some trusty authentication to it.


[Read on 🐹](https://auth0.com/blog/build-and-authenticate-an-emberjs-3-application/?utm_source=dev&utm_medium=sc&utm_campaign=emberjs3)

![Build and Authenticate an EmberJS 3 Application](https://thepracticaldev.s3.amazonaws.com/i/63m1a8attb9dh18wm2a8.png)
Make music with your facial expressions
Tags: showdev, glitch, javascript
Published: 2018-06-26 12:49:57

---
title: Make music with your facial expressions
published: true
description: 
tags: #showdev #glitch #javascript
---

I'm currently at a program called the [Recurse Center](https://www.recurse.com/) (which feel free to ask me about, it's great and meant for people who want to become better programmers!)

They encourage pairing, so for the last couple of weeks I paired with [okay](https://github.com/okayzed) to make [Face the Music](https://face-the-music.glitch.me) which allows you to make music with your facial expressions and then record it as a webm file!

![Face the Music](https://thepracticaldev.s3.amazonaws.com/i/i2d2fg6ifrfjhlhxel1e.gif)
It uses: 
- [clmtrackr.js](https://github.com/auduno/clmtrackr) for the face tracking.
- [Tone.js](https://tonejs.github.io/) for the music.
- [p5.js](https://p5js.org/examples) and p5.dom.js for the drawing on the canvas. 
- [teoria.js](https://github.com/saebekassebil/teoria) for music theory
- [MediaRecorder from the MediaStream Recording API](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder) to record the canvas

It's very experimental and I think should be a finalist for most javascript libraries used in a project. Anywayyy you can remix it on glitch: 

{% glitch face-the-music %}
How can i  buy a vps a 5$ on Digital Ocean?
Tags: digitalocean, hosting
Published: 2018-06-26 11:08:34

---
title: How can i  buy a vps a 5$ on Digital Ocean?
published: true
description: Hello, i tried yo buy a simple hosting pack and they force me to put 100 $ on account, but i just want to buy a vps pack (5$), why i can't?
tags: digital ocean, hosting
---