teleren/devto huggingface dataset:
What to do when you feel Overwhelmed
Tags: motivation, introduction, firstpost, believe
Published: 2017-09-02 02:10:56

---
title: "What to do when you feel Overwhelmed"
published: true
description:  Are you finding it hard to learn something, you feel you can't cope any longer, well this is for you.
tags: motivation, introduction, firstpost, believe
cover_image : https://thepracticaldev.s3.amazonaws.com/i/cktj6us4jf39lekw4gbf.png
---

Hello guys ðŸ˜€, 
We all have gotten to that point where we feel we cant take it anymore, we feel this problem right now is too big for me and this mountain I'm facing is insurmountable.

We've all told ourselves that we cant go past a certain point and by extension, we've limited ourselves.

This is just to someone out there who is where i am right now or where i used to be, just take that bold step and start doing that which you've always wanted to do, tell yourself `I have it within me to be anything I want to be, I'm not limited by what I'm faced, I can make anything work`.Now i know it might seem like ordinary words but just keep telling yourself that till you believe it.
You are what you believe.
ðŸ˜‰
Open Hours: A JavaScript plugin to generate an hours of operations table for your business website
Tags: javascript, plugin, business, showdev
Published: 2017-09-01 19:18:04

---
title: "Open Hours: A JavaScript plugin to generate an hours of operations table for your business website"
published: true
description: "Open Hours: A JavaScript plugin to generate an hours of operations table for your business website"
tags: javascript, plugin, business, showdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/7ua0omkdgql97oph2xmu.png
---

Recently I had to schedule an appointment with my optometrist. On their site, I noticed that they had a list of hours of operation. What stood out to me was that the current day of the week and hours was automatically bolded. I thought that was a simple and yet useful design.

One of my current clients is opening up a restaurant. I thought it would be neat to add this little piece of UI goodness to their upcoming site, but also thought it could be useful for just about any other business. So I spent some time today writing a JavaScript plugin that allows you to define a simple JavaScript object with day and hours of operation and the plugin automatically generates a table and adds it to your DOM.

![Open Hours screenshot](https://thepracticaldev.s3.amazonaws.com/i/tygrmb0zsae4kjr2sbgh.png)

It's written in pure JavaScript so there are no dependencies whatsoever. If you think it'd be useful in a future project of yours, [feel free to grab it on GitHub](https://github.com/michaellee/open-hours). There's a couple of more things I'll probably add to the plugin in the future, so if you'd like to stay in the loop about the plugin, [sign up for my newsletter](http://eepurl.com/bGXerj).

***

Originally posted on [Michael Lee](https://michaelsoolee.com/open-hours-javascript/)
About Me
Published: 2017-09-01 19:05:10

---
title: About Me
published: true
description: 
tags: 
---

I am a native New Yorker, photographer, videographer, blogger, former graphic designer/digital product photographer in the Beauty Industry, and for many years a fashion designer. I first started developing with WordPress in 2007, and ended up choosing Front End Development because it permits me to find practical application to things I love.

My SPECIALTIES include HTML5, CSS3, CSS Flexbox, JavaScript, ES6, NPM, Node, Sass, PostCSS, Gulp, Webpack 2+, Static Website Generators, Liquid Syntax, Command Line, Markdown, Git, Github, Creative Suite, "Candid Camera", Keynote, technical writing, and more.

2017 is the year for conquering React and Ruby on Rails.

When I’m not coding, I love to go to the countryside to recharge, watch Film Noir and mystery movies, listen to music, ponder over surrealist art, and create exotic cuisine.
Remove all console.log()s using Regex in Atom
Tags: regex, atom, texteditor, javascript
Published: 2017-09-01 18:31:00

---
title: Remove all console.log()s using Regex in Atom
published: true
description: How to remove all console.log()s from your JavaScript using Regex in Atom
tags: regex, atom, text editor, javascript
cover_image: https://thepracticaldev.s3.amazonaws.com/i/n976s2x1ia99ih5z82ny.png
---

Using `console.log()` in JavaScript files are great to debug your code. But when it comes to shipping your code to production or a git repo it's good to clean up your code by removing `console.log()`s.

If you're using Atom as your text editor, it's easy to do this using Regex.

1. First pull up the find in buffer bar, by going to **Find > Find in Buffer**.
2. In the first search field titled *Find in current buffer* type in **console.log.*$**
3. Select the *Use Regex* option found in the upper right corner of the search panel that's designated by the icon **\.\***
4. Press **Find All** to find all instances of `console.log()` and then press **Replace All**


!["Find in Buffer panel"](https://thepracticaldev.s3.amazonaws.com/i/krce0r4mjcgeoaivqf4d.png)

In step 2, we used a regex to grab all instances of the string `console.log` till the end of the line. By using `.*$` the `.` indicates we want to match any character, `*` is used to indicate we want to match in indefinite amount of any characters and then finally `$` is used to indicate to match until the end of the line.

If you're wondering why we left the second field of the *Find in Buffer* panel it's because we don't want to replace all the `console.log()`s with anything. By leaving it blank it is saying replace with nothing.

***

Originally posted on [Michael Lee](https://michaelsoolee.com/remove-console-atom-regexp/)
The Not-So-Scary Explanation Of Currying In Javascript
Tags: javascript, webdev, functional, programming
Published: 2017-09-01 16:56:35

---
title: The Not-So-Scary Explanation Of Currying In Javascript
published: true
description: A simple, pretty much jargon free explanation of how to leverage basic currying in Javascript. 
tags: javascript, webdev, functional, programming
---

_If I have a pet hate with the developer community it's that a lot of concepts in technology are simply explained with needless complexity. "Currying" I've found to be one of these ideas. Currying is in it's simplest form pretty simple. Let's take a look at it._

To show you how and why to use currying let us look at an example.

# Currying Explained Simply

Whilst refactoring code I saw a good chance to use Currying.

The code I saw looked like this simplified example: 

```javascript
var contains = function(one, two){
  // Computation
};

var one = {};

contains(one, "Some string")
contains(one, "A different string");
contains(one, "Another string");
```

# Smelling the code

When writing / reviewing / refactoring code we often look for what is known as a "code smells". A code smell is similar to an anti-pattern. It should stop you in your tracks and make you say "hmmm". 

This code gave me a strong whiff of a code smell. 

Why? The repetition of the code `contains(one`.

# A potential upgrade

I immediately started looking for ways to shorten this code. 

A possibility to improve would be to hardcoded the `one` value inside the `contains` function. Like so: 

```javascript
var contains = function(two){
  var one = value;

  // Computation
};

contains("Some string")
contains("A different string");
contains("Another string");
```

This _does_ stop the repetition of always passing the first value. but it reduces the reuse of the `contains` code. 

It couples it to the implementation of the one value. 

So how do we reduce this repetition without creating tight coupling?

# Enter Currying

In order to prevent the repetition of the first variable we can leverage javascripts closure functionality. 

```javascript
var contains = function(one){
  return function(two) {
    // Computation
  }
};
```

	var boundContains = contains(one);

	boundContains("Some string")

	boundContains("A different string");

	boundContains("Another string");

What's happening here? 

* The `contains` function is called once with the variable `one`. 
* The Javascript closure then saves the reference to the one variable in a closure
* The bind contains method is now equivalent to the returned function from inside `contains`
* We can now use the bindContains method, without always passing the one parameter. 
* If the one value changes, now we have only one reference to update.

# Conclusion

This is a simplified example. But hopefully you can see how currying can be used to DRY up our code. 

It doesn't have to be so esoteric either. 

You can even take currying further by creating a `curry` method, but that's a lesson for another day!
What's your trick to tracking your billable hours?
Tags: discuss, softskills, career
Published: 2017-09-01 15:16:02

---
title: What's your trick to tracking your billable hours?
published: true
description: What tools, tips, and tricks do you use to get paid?
tags: #discuss #softskills #career
---

While I'm asking this from the perspective of an employed developer, I'm sure this would apply to freelancers as well. I'm notoriously bad at tracking my time and want to change my ways so I don't play the TimeSheet Guessing Game at the end of the period. I know there are some tools like Toggl and basic note-taking, but it's one thing to know and another to do. Has anyone with the same troubles found something that works for them?
Poker StraightFlush
Tags: dev, algorithms
Published: 2020-05-29 03:31:25

---
title: Poker StraightFlush
published: true
tags: dev,algorithms
canonical_url: https://jma.im/posts/2017-09-02-poker-straightflush/?ref=devto
---

First of all, PHP Code Example. (PHP ≥ 7)

```
function isStriaghtFlush($d) {
    $b = $f = 0;
    $m = ['a'=>1,1=>10,'j'=>11,'q'=>12,'k'=>13];
    foreach ($d as $a) {
        $p = substr($a,-1);
        $b |= 1<<(($m[$a[0]])??$a[0]);
        $f = ($f===0||$f===$p) ? $p : 1;
    }
    $b = ($b << 3) | ($b >> 10);
    foreach (range(0,13) as $i) {
        if ((($b >> $i) & 31) == 31){
            return [true, $f!=1];
        }
    }
    return [false, false];
}
```

### Explain:

`A` can be straight of `A, 2, 3, 4, 5` and `10, J, Q, K A`

There are total 14 ranks, when getting rank `n` from the `$d`, we set 1 of the `n` element in bitwise map.

If we could find any 5 continuously 1 in the bitwise map, then it’s straight. also if all faces are same, then it’s straight flush.

Example, cards: `10, J, Q, K, A`

read `10`, bitwise map: `0,0,0,1,0,0,0,0,0,0,0,0,0,0`

read `J`, bitwise map: `0,0,1,1,0,0,0,0,0,0,0,0,0,0`

read `Q`, bitwise map: `0,1,1,1,0,0,0,0,0,0,0,0,0,0`

read `K`, bitwise map: `1,1,1,1,0,0,0,0,0,0,0,0,0,0`

read `A`, bitwise map: `1,1,1,1,0,0,0,0,0,0,0,0,1,0`

shift left 3 of bitwise map to `1,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0`

shift right 10 of bitwise map to `1,1,1,1`

OR this two bitwise maps and get a new map `1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1`

then we have 5 continuously 1, it’s straight.
How to Give Talks to Developers w/ Ben Orenstein
Tags: techtalks, career
Published: 2017-09-01 12:49:22

---
title: How to Give Talks to Developers w/ Ben Orenstein
published: true
description: 
tags: techtalks, career
---

This is a great talk on how to give engaging tech talks. Ben Orenstein demonstrates how to engage your audience through a series of lightning talks.

{% youtube l9JXH7JPjR4 %}

Main Argument
=============
It is more important to be entertaining than informative. You want people to enjoy and remember your talk.

He gives tons of tips-
- Hit people with the thesis right away
- Throw something weird at them
- Good default language for talks (hold your hands out, rather than crossing your arms)
- To reduce anxiety in advance, practice "power poses" in advance - acting confident makes you feel confident.
- To work with anxiety during the delivery, scan for a "nodder" in the audience and make eye contact periodically - pretend you're giving the talk to this person
- Good information with unenthusiastic delivery bores people - pick topics you care about
- Avoid - "Sorry you can't see this from the back" - check the slides from the back of the room in advance
- Don't apologize in advance to set expectations low
- Don't be afraid of dead sound - if you ask for questions, people need a few seconds to think
- Take a listening pose while waiting for questions
- Speaking in a small, but packed room is high energy compared, but a big room that is half full will feel low energy


Discussion Questions
====================

Have you found any tips that improved your talks?


*Want to watch more talks? I built a search engine for talks -[www.findlectures.com](https://www.findlectures.com). I also [send personalized recommendations by email.](https://www.findlectures.com/form?type=alert)*
Hi, I'm Jérémy Levron
Tags: introductions
Published: 2017-09-01 10:22:25

---
title: Hi, I'm Jérémy Levron
published: true
description: 
tags: introductions
---

I code for 5 years now.

You can find me on GitHub as [19h47](https://github.com/19h47).

I live in __Montpellier__, France and work for [Le Graphoir](http://legraphoir.com/).

I mostly develop in HTML, CSS, JavaScript.

I'm currently learning more about [Vue.js](https://vuejs.org/) and HTML5 Canvas.

Nice to meet you.
1px solid black
Tags: funfacts, css
Published: 2017-09-01 09:13:29

---
title: 1px solid black
published: true
description: 
tags: Fun facts, CSS
---

To remind me the shorthand syntax of the border property, my technique was to think about __Metal Gear Solid__. 

Because, `1px solid black` is like __Metal Gear Solid__, isn't it? ðŸ˜…
First-time experience with Digital Ocean from Shared Hosting Environment 
Tags: digitalocean, docker, cloudcomputing, sharedhosting
Published: 2017-09-01 03:22:47

---
title: First-time experience with Digital Ocean from Shared Hosting Environment 
published: true
description: A review of the cloud platform "Digital Ocean" as known as "DO" in the dev community, originally built and designed for developers. Overall Thoughts and comments on user experience coming from a traditional shared hosting moving to a cloud computing environment. 
tags: Digital Ocean, Docker, Cloud Computing, Shared Hosting
---

<img src="https://thepracticaldev.s3.amazonaws.com/i/pjaazzetr0ds3r8yle1k.jpg" width="100%">

Starting a server has never been easier until now with the days of cloud computing on the horizon. Finding a need to push more performance for better price, shared hosting may be left behind or will it? 

After purchasing a domain name and moving along the commonly followed steps in any hosting service like Host Gator, GoDaddy or Bluehost an average user (Developer) can get a server running within a day. Digital Ocean allows a user to setup a carefully selected instance in less than ten minutes. 

In Developer talk (Jargon), "AWS" is shorten for Amazon Web Services and many developers refer to Digital Ocean as "DO". DO interacts with AWS to spin up your DO instances!    

DO provides you with great security features. You are asked to immediately
reset your password and setup two-authentication to secure your account. Not only this, you can even connect to google's recently added "Google Authenticator" application for an additional level of security. 

Normal firewall settings are found within the profile and can be highly configured for your needs. The overall dashboard experience runs laps around many of the traditional shared hosting sites that are in need of some serious design overhauls. Wink Wink, Hit me up if you want to discuss design suggestions... 

Speaking of design, an interesting feature not commonly seen within most shared hosts was DO's metrics section. A great feature for performance buffs. Many sites like Hostgator or goDaddy have pre-installed packages that are one-click setups but you may not have the level of control over the operating system or barebone setup like you do with Digital Ocean. 

Creating a truly dreamy setup as a developer is no longer a fantasy. Users of all kinds can enjoy the level of simplicity and advanced features Digital Ocean has to offer. 

With that I recommend moving to toward a cloud computing world with us. Give it a go with a Free $10, my treat! Hope you enjoyed this review! 

 
<a href="https://m.do.co/c/c81cb396ae03" style="font-weight: bold;">FREE $10</a>
What is the best test data generator?
Tags: data, testing, discuss
Published: 2017-09-01 03:09:40

---
title: "What is the best test data generator?"
published: true
description: 
tags: data, testing, devdiscuss, discuss
---

Which tool can you recommend to easily generate test data? Tool must be able to read data schema to generate accurate data permutations and download them as csv files
Visual Studio Code Cheat Sheet 
Tags: vscode
Published: 2017-08-31 21:50:23

---
title: Visual Studio Code Cheat Sheet 
published: true
description: A compilation of shortcuts
tags: vscode
---

> I will update this post as I found shortcuts in vscode that I consider might be useful :)

## Select and edit text based on a regex

1. Ctrl+F : Open find widget.
2. Alt+R : Turn on regex mode.
3. Input search text : Regex text or normal text.
4. Alt+Enter : Select all matches.
5. Left arrow : Adjust cursors. (Ignore this step if you don't want to edit the selected text.)
6. Edit text : Do what you want.(Ignore this step if you don't want to edit the selected text.)
7. Shift+Home : Select modified text.(Ignore this step if you don't want to edit the selected text.)
8. Ctrl+C : Copy selected text.
9. Ctrl+N : Open a new tab.
10. Ctrl+V : Paste.

![Example](https://cloud.githubusercontent.com/assets/6732524/14766916/01868528-0a4c-11e6-9a94-81a8340a0ccb.gif "Example")


## Compare files


1. Open the first file to compare.
2. ⌘ + ⇧ + P to bring the menu
3. Type: Files: Compare Active File With...
4. Select the file to compare to.
In consistency lies the power
Tags: programming, webdev, beginners, career
Published: 2017-08-31 19:52:44

---
title: In consistency lies the power
published: true
description: 
tags: programming, webdev, beginners, career
---
When starting out as a beginner in the world of software development, it is very imperative that you do not lack passion and drive in your pursuit. Many times as software developers, it sometimes happens that we get tired and weary. When times like this come up, the most important thing is that you make tireless effort to keep coding. Just like what Chris Sevillaja, the founder of scotch.io rightly says **“Slapping the keyboard until good happens”**.

As developers, we have to keep going. I recently read a blog post by Faye Bridge on blog.teamtreehouse.com. She interviewed Chris Dabatos, a web developer who couldn’t afford his own computer. He went on to learn to code with Treehouse during his free time at work. After 3 months of dedication, Chris landed a junior developer position at a processing company. Less than a year after that, Chris became the main developer for the company.

In this interview, Chris was asked to give an advice for students and people who are just learning to code and here is his reply

> _My #1 piece of advice is to not give up and to not doubt yourself. Know your value. I don’t tell many people this, but I actually signed up for Treehouse 3 months before I began to take it seriously. I decided it would never happen for me so I cancelled. But afterwards, I had this inkling feeling telling me, **“Chris, if you don’t go all in and learn how to code, you will regret it forever.”** So, I signed up again, went all in, and became a developer in 3 months._

So keep coding people. In consistency lies the power.
When Code Duplication is the Right Answer w/ Sandi Metz
Tags: techtalks
Published: 2017-08-31 17:23:56

---
title: " When Code Duplication is the Right Answer w/ Sandi Metz"
published: true
description: ”Let’s learn how to add new behavior without editing existing code.”
cover_image: https://thepracticaldev.s3.amazonaws.com/i/imnvlqez8fy0fz6599dy.png
tags: #techtalks
---


_This talk blew my mind and I thought it would benefit the DEV community._


{% youtube 8bZh5LMaSmE  %}

### Main Argument

Sandi equates trying to fix a problem by increasing the complexity of the wrong abstraction, with chasing a beach ball on the outgoing tide. She urges us to prefer duplication over abstraction in our code. DRY isn’t bad and duplication isn’t good. But, if your choice is between duplication and the wrong abstraction, the right choice is duplication. 

### Let’s Discuss
Sandi offers this quote, “Make the change easy, this might be hard, then make the easy change”, as guidance. She advises us not to get lost trying to get to the future with our code, but instead to  aim for code that can adapt for the future when it arrives (with the idea of making small objects that have single responsibility at it’s core). What are your thoughts about this?
Solving Imaginary Scaling, at Scale (the talk!)
Tags: techtalks
Published: 2017-08-31 15:58:24

---
title: Solving Imaginary Scaling, at Scale (the talk!)
published: true
description: "It's about a little knowledge being a dangerous thing"
tags: techtalks
---

Last year I made this parody book cover and tweeted it from [@ThePracticalDev](https://twitter.com/thepracticaldev):

{% tweet 800752571497545729 %}

NPM co-founder [Laurie Voss](https://twitter.com/thepracticaldev) had a lot of fun with it on Twitter _and_ used it to inspire a talk. This talk, which he gave earlier this summer at [DinosaurJS](https://dinosaurjs.org/) is awesome and absolutely informative. I highly recommend watching it below:

### DinosaurJS 2017: Solving Imaginary Scaling Issues, at Scale by Laurie Voss

{% youtube FJByltoGnA8 %}

"It's about a little knowledge being a dangerous thing" - Laurie Voss

# ðŸ‘ ðŸ‘ ðŸ‘ ðŸ‘ ðŸ‘
Product Personalization Made Easy with Magento Product Designer Extension
Tags: magento, productdesigner, php, webdev
Published: 2017-08-31 07:05:09

---
title: "Product Personalization Made Easy with Magento Product Designer Extension"
published: true
description: Responsive product designer Magento extension allows your customers to personalized their products like t-shirts, caps, cards, gifts, mobile cases, skin, posters, mugs, etc.

tags: Magento, product designer, php, webdev

---
Offer your customers a whole new range of customized products including T-shirts, Mugs, Gifts, Skin Covers, Stationery etc. with the help of AppJetty's world-class and customer engaging Magento Product Designer Extension -  **Advance Product Designer**. Using this powerful Html5 Online Product Designer Tool, your customers can craft a printable design on the product of their choice, review the product and place an order. If you are looking for a perfect Web 2 Print Software Solution for your business, Advance Product Designer is your way to go!

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

A Responsive Product Designer Tool For Magento

Advance Product Designer Tool provides your customers with the freedom to work around their design flawlessly on any device. Be it a tablet, a mobile, an iPad or a desktop, our custom product designer extension for Magento is fully responsive and will help your customers to design their product in few clicks. Advance Product Designer is here to enable your customer's design creative masterpieces from any device, at any time!

* Product Templates
* Image Filters
* Curved Text
* Artistic Drawing
* Social Sharing
* Name & Number
* Text Shadow
* Custom Image

**Product URL:  [https://www.appjetty.com/magento-product-designer.htm](https://www.appjetty.com/magento-product-designer.htm)**
**Demo : [Product Designer Live Demo](http://m1productdesigner.appjetty.com/index.php/productdesigner/index/demo/id/1070/templateid/264/)**