teleren/devto huggingface dataset:
Learn to Chain Map, Filter, and Reduce Method In Javascript
Tags: javascript, es6, react
Published: 2018-11-19 04:30:00

---
title: Learn to Chain Map, Filter, and Reduce Method In Javascript
published: true
description: Learn to Chain Map, Filter, and Reduce Method In Javascript
tags: #javascript #es6 #js #react
---

Post Link : <a href="https://www.skptricks.com/2018/11/learn-to-chain-map-filter-and-reduce-in-javascript.html" >Learn to Chain Map, Filter, and Reduce Method In Javascript </a>

This tutorial explains how to chain Map, Filter, and Reduce Method In Javascript. You may have seen method chaining examples in Jquery, java etc programming language. Since all three are called on arrays and since map() and filter() both return arrays, we can easily chain our calls.

<a href="https://www.skptricks.com/2018/11/learn-to-chain-map-filter-and-reduce-in-javascript.html" >Learn to Chain Map, Filter, and Reduce Method In Javascript </a>

<img src="https://1.bp.blogspot.com/-m098Uxk6aD8/W_GmkXCPQ5I/AAAAAAAACKA/QSET9tdeHcQXRiEEMCP4h5JnpMvOjBt9ACLcBGAs/s400/chain.png" />


<a href="https://www.skptricks.com/2018/11/learn-to-chain-map-filter-and-reduce-in-javascript.html" > Read More... </a>
SP Calendar Pro- Lightweight JavaScript library to easily manage SharePoint calendar events.
Tags: sharepoint, calendars, javascript, soap
Published: 2018-11-19 04:09:34

---
title: SP Calendar Pro- Lightweight JavaScript library to easily manage SharePoint calendar events.
published: true
description: A lightweight JavaScript library to easily manage SharePoint calendar events.
tags: SharePoint, Calendars, JavaScript, SOAP
---

I have realized how painful it is to deal with SharePoint calendars, especially gathering recurring events. So I have created this small (~350 lines) vanilla JS library to simplify managing common calendar operations.

Key features:
-Easily get recurring calendar events
-Filter the collected events to return only the events that occur before or after user-specified dates.
-Convert datetime rows in a SharePoint form into proper JavaScript date objects.
-Any list within a site collection can be queried- the list does not have to originate from the same subsite.

<a href="https://spcalendarpro.sharepointhacks.com/">Full Documentation</a>

<a href="https://github.com/samperrow/SPCalendarPro">Source code</a>
the time I had to bodge
Tags: javascript, php, modx
Published: 2018-11-18 23:37:26

---
title: the time I had to bodge
published: true
description: bodging is the art of quick fixing, and it saved us several man hours at my job.
tags: javascript, php, modx
---

At my job we use a cms called modx, which I love; it’s open source, it’s php, and you’re able to make it do a lot of things with very little effort. But the one issue I have with this system is that plugins that exist for it exist in a dichotomy, ‘has documentation’ vs. ‘no documentation’.

A client had a book on teaching, they wanted to include a glossary of all their terms in their website.

Sure, why not?

So we added a plugin called... Glossary. It worked great, not a lot of documentation, but we figured it out still. And then we noticed something weird.

Why was Developmental Difficulties lower than Distance Theory (these aren’t actually related to the client they’re just an example).

For whatever reason, they weren’t sorting in an ascending order. For this client that was gonna be an issue.

I’m not great at php, my few forays into it have been less than successful, but I gave it a shot. I read through some of the code, since like I said, documentation was lacking. But I couldn’t really make heads or tails of it.

Deadline is maybe a week out, and with thanks giving coming up, that means we have like four more days of development left before the site needs to be ready to go live. Another developer found a plugin that would sort them into alphabetical order, but had way less documentation than the first plugin. And we would have to throw out work we had already done on and do it all over again.

So I sat down and spent maybe 15 minutes studying the layout of the page, changed a couple lines of the chunks that the glossary app used, and built a small javascript function to grab all the categories, sort each item in the category, and the. Put them back together as html elements and put it back in place.

All in all, 45 minutes of coding, maybe an hour of total development time.

Is it a perfect solution? No, if someone doesn’t have javascript turned on, it will just say loading indefinitely. Whatever, I’ll fix it on Monday. It’s good enough to go live, and we don’t have to spend anymore man hours on it than we already have. It’s a bodge, it’s a temporary fix. It’s not elegant, its certainly not impervious, but it’s maybe 16 lines of code, and it works and doesn’t break responsiveness, and it saved us maybe 8 hours of rebuilding what we already have. So I’m proud of that!

I’m interested to hear what other bodges people have come up with?
I created a game - part 1 [Löve2d]
Tags: lua, gamedev, love2d, javascript
Published: 2018-11-18 23:03:49

---
title: I created a game - part 1 [Löve2d]
published: true
description: We look into creating a game in love2d
tags: lua, gamedev, love2d, javascript 
---

{% youtube mJ3VU5OFe10 %}
create-nextron-app: Create an Electron with Next.js app in one command
Tags: javascript, nextjs, electron, showdev
Published: 2018-11-18 22:37:05

---
title: create-nextron-app: Create an Electron with Next.js app in one command
published: true
description: With npx or yarn, `create-nextron-app` enables us to create the Electron with Next.js apps in one command.
tags: javascript,nextjs,electron,showdev
---

Thanks to `npx` or `yarn`, you can create [Nextron](https://github.com/saltyshiomix/nextron) (Electron + Next.js) apps in one command :)

## TLDR

Use [create-nextron-app](https://github.com/saltyshiomix/create-nextron-app).

```bash
# with npx
$ npx create-nextron-app test-app

# with yarn
$ yarn create nextron-app test-app
```

## CLI Options

By using `--example` option, you can specify an example to create.

```bash
# with npx
$ npx create-nextron-app test-app --example with-typescript-material-ui

# with yarn
$ yarn create nextron-app test-app --example with-typescript-material-ui
```

## Examples

All examples are listed [here](https://github.com/saltyshiomix/nextron/tree/master/examples).

There are 12 examples for now:

    - custom-build-options
    - custom-server
    - custom-server-nodemon
    - custom-server-typescript
    - ipc-communication
    - parameterized-routing
    - with-javascript
    - with-javascript-ant-design
    - with-javascript-material-ui
    - with-typescript
    - with-typescript-less
    - with-typescript-material-ui

## PRs and Contributions are Welcome

I'm new to OSS and have some beliefs for Nextron:

1. Show a way of developing desktop apps only web knowledge
2. Easy to use
3. Be transparent (Open to OSS developers)

{% github https://github.com/saltyshiomix/nextron %}

{% github https://github.com/saltyshiomix/create-nextron-app %}

## Conclusion

Developing Electron apps is sometimes facing a problem, so I hope that `nextron` or `create-nextron-app` helps those who want to create Electron with Next.js apps :)

Thank you for your reading this article.

Best,
angular package
Tags: angular
Published: 2018-11-18 22:13:08

---
title: angular package
published: true
description: 
tags: Angular
---
I recently started learning Angular framework. I am a little confused about this package: https://www.npmjs.com/package/angular. What does it package do? The latest release of this package is 1.7.5 and my understanding this is designed for AngularJs(1.x) only? The latest Angular release is already 7.x.x. Since Angular framework has so many libraries, how Angular team align the latest release version with different libraries, is it always as same as @angular/core's release's version as default convention. Can someone please explain or point me to good reference. Many thanks & have a good day!
i18n of React with Lingui.js #2
Tags: react, javascript, i18n
Published: 2018-11-18 22:02:15

---
title: i18n of React with Lingui.js #2
published: true
description: In this post, I want to show how to use Lingui.js to do i18n/l10n of React applications
tags: [react, js, i18n]
cover_image: https://thepracticaldev.s3.amazonaws.com/i/l7mb2u74g97zbfov2phw.png
series: i18n of React with Lingui.js
---

In this post, I want to show how to use Lingui.js to do i18n/l10n of React applications. I will use Node 10.10 and `yarn`, but I guess `npm` and other versions of Node would work too. The full source code is [here](https://github.com/stereobooster/react-lingui-example). Each step of the tutorial is done as a separate commit, so you can trace all changes of the code.

## Advanced usage

### Language switcher

Simplest language switcher can be implemented this way:

```js
import * as React from "react";
import { withI18n } from "@lingui/react";

const Navigation = ({ i18n, locales }) => (
  <select selected={i18n.locale}>
    {Object.keys(locales).map(locale => (
      <option key={locale} onClick={() => i18n.activate(locale)} value={locale}>
        {locales[locale]}
      </option>
    ))}
  </select>
);

export default withI18n(Navigation);
```

`withI18n` is a HOC, which provides `i18n` object. The same one which we pass to `<I18nProvider i18n={i18n}>`.

`i18n.locale` provides current locale.

`i18n.activate` changes current locale.

### Translate text without `Trans` macro

```js
import { I18n } from "@lingui/react";
import { t } from "@lingui/macro";

// ...

<I18n>
  {({ i18n }) => (
    <button onClick={() => alert(i18n._(t`You're looking good!`))}>
      <Trans>Show motto of the day</Trans>
    </button>
  )}
</I18n>;
```

`I18n` is a "Render Prop" component, which provides `i18n` object. The same one which we pass to `<I18nProvider i18n={i18n}>`.

`i18n._` is a translation function, which will actually do the translation.

`t` is a macro which is used by `extract` command.

To provide default value for translation use comment:

```js
i18n._(/* i18n: Default value for Hello {name} */ t`World`);
```

### `Plural`

Use `Plural` macro if you need to deal with numbers.

```js
import { Plural } from "@lingui/macro";

// ...

<Plural
  value={count}
  _0="There're no books"
  one="There's one book"
  other="There're # books"
/>;
```

### `DateFormat`

Use `DateFormat` to format dates.

```js
import { DateFormat } from "@lingui/macro";

// ...

<Trans>
  Today is <DateFormat value={new Date()} />
</Trans>;
```

### `NumberFormat`

Use `NumberFormat` to format numbers.

```js
import { NumberFormat } from "@lingui/macro";

// ...

<NumberFormat value={2000} format={{ style: "currency", currency: "USD" }} />
<NumberFormat value={0.2} format={{ style: "percent" }} />
```
To All Ye Naysayers - It's OK, I Know My Value 😃
Tags: beginners, discuss, webdev
Published: 2018-11-18 21:47:33

---
title: To All Ye Naysayers - It's OK, I Know My Value 😃
published: true
description: 
tags: beginners, discussion, webdev
---
![certificate](https://thepracticaldev.s3.amazonaws.com/i/ltpkk3ht3ridfnpj98fs.png)

I managed to bag my second [FreeCodeCamp](https://freecodecamp.org) (FCC) certification for Javascript Algorithms and Data Structures and shared it to my small following on twitter. Before I knew it a fair few people had seen it due to Quincy (FCC founder) responding to the tweet.

I wasn't surprised by the amount of nice comments and congratulatory messages received as this community is awesome. I did manage to attract a couple of tweets which weren't as, well, congratulatory. They focused on the fact that the certificates didn't have any real value - meh 😒. Whilst what they tweeted didn't really bother me, I thought it important to share my responses so other people who come across the same attitude can see things in a better perspective.

##### Tweet 1
![Tweet 1](https://thepracticaldev.s3.amazonaws.com/i/yz2s99pdig4k4hx335yg.png)

##### Tweet 2
![Tweet 2](https://thepracticaldev.s3.amazonaws.com/i/8fe7shs47y4ulnlzsr7a.png)

Yes, technically, the certificates don't hold value, but then neither does our university degree right? The value these items hold are the blood, sweat, and tears we put in. The hundreds of hours of effort and time. The sacrifice. And the knowledge gained.

So if anyone tries to downplay your achievements - just let them know. But more importantly, make sure you know exactly what the each milestone you achieve means. And celebrate like a boss 👑.

P.S if you want to be a part of a support newbie community, come join us on [Discord](https://discord.gg/n7JNnK2)

Happy Coding!

_Thanks for reading. If you want to join along in my coding journey come say hi 👋 on twitter. I can be found [@lawyerscode](https://twitter.com/lawyerscode)_
Semi colons;
Tags: javascript, discuss
Published: 2018-11-18 21:42:13

A close friend and I got into an argument a couple days ago because he wholeheartedly believes (ECMAScript) code without semi colons _equals bad practice_ for reasons I understand completely but don't agree with. (we fight about important things like this all the time)

I personally write JavaScript without semi colons and am are very opinionated about it. The same goes for more people here on devtoo. I found that for instance moji has none either.

There is a wide abundance of discussions and people arguing about it on the internet so.

Where exactly in the ECMAScript specification does it say that semi colons are omitted/required or not?
Organizing yourself to start coding and stop preparing
Tags: discuss, webdev, imposter, advice
Published: 2018-11-18 21:20:24

---
title: Organizing yourself to start coding and stop preparing
published: true
description: Getting past the imposter and into the code
tags: discuss, webdev, imposter, advice
---

A wildly undervalued topic (or at least so I've seen) surrounds getting yourself from tutorial watching, reading, and planning to getting your first code down and ready to start architecting your application.


Personally, no matter how big or small a project is anymore, I feel the pre project jitters. The constant voice who tells you to wait, learn some more, read some more etc before diving in. 

You don't want to dive in and get stuck right? Or maybe you're worried about proving the imposter right.

Let's open up a discussion surrounding the actions you deploy to get yourself confident enough to crack open VSCode and get to work.

I'll start it off. 

( I mainline React applications, so it has some specifics, but you can apply it however you'd like! )

Recently I've gotten super into using my Wipebook to sketch out the main design that comes to mind. Whatever I'm going to build there has to be an initial idea that hits that JUST MIGHT be the one. 

From there, I'll usually start to break down each piece of the website into components. What's the component? Does it have children? What are they called? This helps me start to think deeply about where I'm going AND how I'm going to get there.

Then comes time to crack open the editor and NOT start writing the tough stuff. There is an endless amount of questions that need answers before feeling confident enough to start building things out.

What does each component need to do? 

Where's the data coming from? 

How am I handling the error or the success? 

What about the time the user's waiting????? 

Overwhelmed?? Me too. 

So instead of worrying about the complicated pieces, I just start scaffolding the HTML. Then move on to thinking about the class names. From there I can start breaking my code into components and deeper and deeper you will journey.  

You'll be shocked how much just doing this, puts you in a more confident mind set. Suddenly you have the start to your project more planned out than you had expected and even have some code written. 

How about you Dev.to'ers? How do you start your projects?
“Move files around until it feels right”
Tags: selfnote, productivity, react
Published: 2018-11-22 03:31:33

---
title: “Move files around until it feels right”
published: true
tags: Self Note, Productivity, React
canonical_url: https://www.slightedgecoder.com/2018/11/18/move-files-around-until-it-feels-right/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/6k490fv50k352qizx8jt.jpg
---

_Photo by [Jaime Casap](https://unsplash.com/photos/cXqBxWB4upA?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/search/photos/feels-right?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)_

_Note to self…_

A user [u/iKenshu](https://www.reddit.com/user/iKenshu/) asked following question on Reddit.

> how to structure my project folder for something like a portafolio o simple web page
> 
> <cite>u/iKenshu</cite>

And `u/timmonsjg` [responded](https://www.reddit.com/r/reactjs/comments/9t5sic/beginners_thread_easy_questions_november_2018/e9aof1l/) with [Dan Abramov’s site](http://react-file-structure.surge.sh/), which reads,

> move files around until it feels right
> 
> this is [not a joke](https://mobile.twitter.com/dan_abramov/status/1027248875072114689)
> 
> <cite>Dan Abramov<br></cite>

That advice of “trial and error” works initially but we will barely have time to enjoy our life.

There is an effective way when adopting his advice.

It’s called **_explore/exploit trade-off_**.

![](https://i2.wp.com/www.slightedgecoder.com/wp-content/uploads/2018/11/atomic-habits-page-223.png?fit=652%2C1024&ssl=1)<figcaption>Page 223 of “<a href="https://jamesclear.com/atomic-habits" target="_blank" rel="noreferrer noopener" aria-label='Page 223 of "Atomic Habits" by James Clear (opens in a new tab)'>Atomic Habits</a>” by James Clear</figcaption>

Move files around initially and after gaining experience, stick to what you know and tried 80~90% of the time.

And keep experimenting the rest of the time (10~20%).

That 10~20% will help you adopt the changes required in your project or even come up with a “blockbuster” process, which would work for many.

_The post [“Move files around until it feels right”](https://www.slightedgecoder.com/2018/11/18/move-files-around-until-it-feels-right/) appeared first on [Sung's Technical Blog](https://www.slightedgecoder.com)._
Why is your preferred programming language your go-to?
Tags: discuss, beginners, programming
Published: 2018-11-18 19:55:19

---
title: Why is your preferred programming language your go-to?
published: true
description: A quick write up on why I love Python and you love your go-to language!
tags: discuss, beginners, programming
cover_image: https://thepracticaldev.s3.amazonaws.com/i/7nebbnpftt47z5lmm04w.jpg
---

I got asked on Twitter why I love Python so much, and I thought I would do a quick writeup, then open this up to a discussion on why your preferred language is your go-to. 

Python was my first programming language, and it made me fall in love with writing code in the first place. I was able to write games and helpful scripts with very little programming experience. I also started my software engineering career with writing Python code for data science scripting. I'm not sure that my career would exist without the Python programming language, to be totally honest.

Python's syntax is so similar to written English. Its guiding principles are outlined in [The Zen of Python](https://www.python.org/dev/peps/pep-0020/), which is a poem that all programmers should take into account (I even named my blog after it and have it hanging on the wall in my apartment. Four lines in particular really speak to me:

`Explicit is better than implicit.`
`Simple is better than complex.`
`Readability counts.`
`If the implementation is hard to explain, it's a bad idea.`

I think those guidelines make the language easy to understand and write code with.

I also really appreciate how diverse the use cases are for it. [Django](https://www.djangoproject.com/) makes creating web apps straightforward and extendible. [Pandas](https://pandas.pydata.org/) makes data manipulation a breeze, and the data science libraries are unparalleled. It's also great for solving code challenges because of the utilities in the standard library. [IPython notebooks](http://jupyter.org/) are awesome for teaching and creating shareable and accessible code.

Some other notable features include:

* list comprehensions, which are a really elegant way of transforming data
* you can extend Python relatively easily with C or C++ which you can use to write faster-running utilities if needed
* meaningful whitespace: I'm going to indent my code anyways, I should get something in return for that!
* a great and supportive community behind the language

## So, what is your go-to programming language and why?

*Note: There are a lot of programming languages I have written code in, and I like a lot of them as well. Python is just the language that I do code challenges with. Also, totally understand that different languages are good for different things. This isn't meant to be a debate, just a display of love for languages that have been helpful for us!*
Hacktoberfest is over but…
Tags: selfnote, hacktoberfest, todayilearned
Published: 2018-11-22 03:37:14

---
title: Hacktoberfest is over but…
published: true
tags: Self Note,hacktoberfest, TIL
canonical_url: https://www.slightedgecoder.com/2018/11/18/hacktoberfest-is-over-but/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/wk6uorh8j7m532vu3nfg.jpg
---

_Photo by [Neil Thomas](https://unsplash.com/photos/SmFBUCgcTn0?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/search/photos/digital-ocean?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) (Digital Camera + Ocean)_.

_**Note to self...**_

Hacktoberfest is over but it has helped me to quickly do a PR for simple typo fixes.

The more I do a PR the easier it seems to contribute.

Did a [quick PR](https://github.com/h2non/node-imaginary/pull/18) to fix a typo (merged at this point) in an open source project documentation for [node-imaginary](https://github.com/h2non/node-imaginary).

I now see what [Digital Ocean](https://www.digitalocean.com/) (DO) was trying to achieve with Hacktoberfest.

Not only were DO trying to giving back to the developer community, DO was trying to help us developers to get used to the **process** and contribute more, which helps others as well.

취지가 정말로 좋은것 같습니다. (_better expressed in Korean_).

The post [Hacktoberfest is over but…](https://www.slightedgecoder.com/2018/11/18/hacktoberfest-is-over-but/) appeared first on [Sung's Technical Blog](https://www.slightedgecoder.com).
Git: How to delete all local branches except master
Tags: git, powershell, sourcecontrol
Published: 2018-11-18 18:33:18

---
title: Git: How to delete all local branches except master
published: true
description: 
tags: git, powershell, source control
---

Checkout to `master` branch.

The command to delete all branches except master is:
`git branch | grep -v "master" | xargs git branch -D`

To use the same command in Windows we have to install [some utilities](https://github.com/bmatzelle/gow/releases)

Or, we can use PowerShell command that do the same thing that above command do:
`git branch | %{ $_.Trim() } | ?{ $_ -ne 'master' } | %{ git branch -D $_ }`
or
`git branch -D  @(git branch | select-string -NotMatch "master" | Foreach {$_.Line.Trim()})`
![Alt text of image](https://thepracticaldev.s3.amazonaws.com/i/a4ml56n1o8gyycxt50u7.png)