teleren/devto huggingface dataset:
I'm launching Almighty - powerful configurations for macOS
Tags: macos, swift
Published: 2019-05-15 20:28:10

---
title: I'm launching Almighty - powerful configurations for macOS
published: true
description: 
tags: macos,swift
---

Product Hunt https://www.producthunt.com/posts/almighty
Gumroad https://gumroad.com/l/lbZCs

<img width="1680" alt="s1" src="https://user-images.githubusercontent.com/2284279/57806889-5f3e6080-7760-11e9-9553-c3816b177876.png">

---

Hi, I'm thrilled to announce my next macOS app. Almighty is a convenient and easy to use macOS menu bar application that exposes powerful configurations for your mac. This simplifies tedious settings, and allows fantastic controls that we can only do through verbose Apple scripts or command lines

There are many features, and the list is growing

🌅 Launch at login
👻 Show hidden files in Finder
🖼 Save screenshots to Downloads folder (By default screenshots are saved in Desktop)
🛑 Stop macOS release notification (Stop alert for installing new major release of macOS)
🚫 Stop macOS software update notification
🙈 Minimize all windows (Reveal the desktop with all windows minimized)
👮‍♀️ Stop iTunes (Stop iTunes from automatically opening)
👀 Toggle file extensions in Finder (By default, certain file extensions are hidden)
👮 Stop Photos (Stop Photos from automatically opening)
🤠 Show full path in Finder (Show full path in Finder title bar)
🎃 Hide desktop icons (Hide all desktop icons visibility)
🌃 Launch screensaver (Launch your default screensaver)
🏖 Clear clipboard (Clear all items in clipboard)
☀️ Keep macOS awake (Prevent macOS from going to sleep mode)
🌙 Do not disturb (Turn on 'do not disturb' mode when external screens are connected, this is to avoid unwanted notifications under presentation)
⌨️ Lock keyboard (Disable built-in keyboard for cleaning. Screen and touchpad function as normal. For machines with HID driver keyboard, this can lock keyboard but can't unlock)

If you get warning about "damaged and can’t be opened" when opening Almighty, you can disable GateKeeper by following https://www.iotgadgets.com/2018/09/how-to-fix-application-is-damaged-and-cant-be-opened-error-in-macos-mojave-and-high-sierra/

More features to come, any suggestions are more than welcome

Original post https://github.com/onmyway133/blog/issues/240
Playing with Go: Functions as a parameter
Tags: go, beginners, functions, learning
Published: 2019-05-15 18:59:17

---
title: Playing with Go: Functions as a parameter
published: true
description: function as a parameter in golang
tags: golang, beginner, functions, learning
cover_image: https://golang.org/doc/gopher/appenginegopher.jpg
canonical_url: https://flrnprz.gitlab.io/playing-with-go-functions/
---
Fantastic cover image thanks to [_golang.org_](https://golang.org/doc/gopher/)

There are a few things very terrifying for beginners when we are learning to code. One of them is passing functions as a parameter to other functions.

> Functions are _first class values_ in Go: Like other values, functions values have types, and they may be assigned to variables or passed to or returned from functions. A function value may be called like any other funcion. - [The Go Programming Language,  Alan A. A. Donovan, Brian W. Kernighan](https://www.goodreads.com/book/show/25080953-the-go-programming-language)

Have you ever wonder why do we pass functions in the first place? If you are an experienced engineer you probably already know the answer. There is a lot of good reads and tutorials about _how to_ pass functions as parameter to other functions, but if you add `why` to the formula, the results are a bit scarce. 

The perfect example is a Map() function
```go
func Map(n []int, f func(x int) int) []int {
   result := make([]int, len(n))
	for i, v := range n {
		result[i] = f(v)
	}
	return result
}
```
With the same function we can have **different behaviours** just changing the callback function! Let's see another example:

{% gist https://gist.github.com/flrnprz/344cb5f3f6ae72cf5372ab554122930a %}

In this example, as we can see, `double` and `square` are both variables with function values of type `func (int) int`, remember our definition at the beginning? The important thing here is that we didn't modified our Map function. Instead, we added the flexibility to parametrize it's behaviour thanks to the function callbacks! How awesome is that?

And this is one example why languages that let you treat functions as a _first class values_ are so powerful!

Please, keep in mind that I'm learning! if you find something that can be optimized or better explained let me know! I'd love to hear about it!

Happy asking _why the #%&?_!
Expanding The DEV Core Team!
Tags: meta
Published: 2019-05-15 18:59:03

---
title: Expanding The DEV Core Team!
published: true
description: We are so excited to officially welcome two new software engineers to the DEV core team.
tags: meta
---

We are so excited to officially welcome two new software engineers to the DEV core team: Anna (@lightalloy) and @rhymes. 

Anna was one of our earliest DEV members (her user id # is lower than `1000`!).  She has actually been working with us for a few months now. She's been a major contributor to the code base and has led some serious refactoring campaigns. You can read more about Anna here: 

{% link https://dev.to/lightalloy/joining-the-dev-team-1fg2 %}

Our newest team member is Rhymes -- who probably doesn't even need an intro! Rhymes has been a prolific contributor to both the platform and codebase. We used to dream about Rhymes joining the team and we're so happy that it’s become a reality. You can learn more about Rhymes here: 

{% link https://dev.to/rhymes/i-m-joining-the-dev-team-3mi8 %}

The DEV Team is almost 20% located outside of the US now :)


Happy Coding!
Build a simple CSS grid layout system
Tags: css, html, sass, gridsystem
Published: 2019-05-15 18:48:52

---
title: Build a simple CSS grid layout system
published: true
description: You must be very familiar with the layout system of popular CSS frameworks like Bootstrap, Bulma, etc. But have you ever wondered how these are built and work behind the scenes. 🤔
tags: css, html, sass, grid system
cover_image: https://cdn-images-1.medium.com/max/1500/1*ZBWYRxOVmbnSo1Oq5PD13w.jpeg 
---

You must be very familiar with the layout system of popular CSS frameworks like Bootstrap, Bulma, etc. But have you ever wondered how these are built and work behind the scenes. 🤔

In this story, lets try to build our own grid layout system and understand the basics. 😃

I’ll be using Sass for this project so that less code can be written. Sass is really simple, and it won’t be difficult for you to follow along if you are a pure CSS person.
<a href="https://sass-lang.com/guide">Official Sass</a> guide is a great place to start learning Sass.

Lets begin by defining the responsive breakpoints

![](https://thepracticaldev.s3.amazonaws.com/i/5d6xziawoxoxciv8hcj7.png)

These will declare the various screen sizes our grid would support.

Next lets style the rows and columns

![](https://thepracticaldev.s3.amazonaws.com/i/bg9nec2dm08hgc5jx3mn.png)

The next few lines will be the core of our layout, basically we’ll loop through the breakpoints map and add media queries and create 12 columns for each breakpoint. We’ll also include containers for each breakpoints.

![](https://thepracticaldev.s3.amazonaws.com/i/hta7v1q3s0pidgksabnc.png)

Just imagine the amount of code that we would have had to write for the same thing in CSS. 🤦‍♂️ Anyways moving forward.

To calculate the width of the column we need to divide the columns into 12 groups based on their size in terms of percentage.
So to do that lets write a function in Sass that takes the column size as an argument and returns the width in percentage.

![](https://thepracticaldev.s3.amazonaws.com/i/sjshnfz6ui7vz8g1593c.png)

And then call the function inside the for loop

![](https://thepracticaldev.s3.amazonaws.com/i/qt3puqqt6w8nmmzgym6e.png)

That’s it we are done with the12 column layout system 🍻.

As a bonus feature lets write a class that will remove the column margin and update our calcWidth() function accordingly.

![](https://thepracticaldev.s3.amazonaws.com/i/fywnam2lohpc5wf0ag1z.png)

Have a look at the layout in <a href"https://codepen.io/Vijit_Ail/full/GaREVo">action</a>. Resize your browser and see how the columns behave.

<hr>

Thanks for reading the post. If you would like to add any other feature let me know below or you can DM me on Instagram <a href="https://instagram.com/vijit__ail">@vijit__ail</a>

<i>This post was originally posted on <a href="https://medium.com/@vijit2ail/build-a-simple-css-grid-layout-system-8e37e3e16d5f">Medium</a></i>
Javascript private fields are coming
Tags: hashtag, javascript, confusingcode, ecma
Published: 2019-05-15 18:34:14

---
title: Javascript private fields are coming
published: true
description: Javascript private fields will be introduced and they aren't quite what you expected...
tags: #Hashtag, Javascript, "Confusing Code", ECMA
---

Turns out that node stage 3 right now we will have private class properties. And it is exactly as you thought it would be:

```
class Point {
	private int x = 0;
	public int y = 0;
}
```

Just kidding it is actually

```
class Point {
  #x;
  y;

  constructor(x, y) {
    this.#x = x;
    this.y = y;
  }

  equals(point) {
    return this.#x === point.#x && this.y === point.y;
  }
}
```

Queue a bunch of WTF moments.

So I started to search around for a bit for an explanation, because surely there must be a good reason. And there are lots of people trying to explain and they haven't got that far. And I came across where one guy would try to explain it:

[Jamie.build](https://jamie.build/javascripts-new-private-class-fields.html)

Reason:
(1) Because of #encapsulation (see the "Encapsulation" section above), we need to allow public and private fields with the same name at the same time. So accessing a private field can't just be a normal lookup.

Wait why is that? Why do we need to allow `private` and `public` fields with the same name.

(2) Private fields won't be able to support the second syntax (because it needs to be static) and that could lead to confusion

That statement leads to confusion, what needs to be static, are we saying that private properties need to be static. No, they clearly aren't static, because each instance has a different property.

(3) We need to support `this.#x === other.#x && this.#y === other.#y;`

No you don't and actually and wait a second, how do you even know that `other` has a `#x` in the first place

```
class Point {
  #x;
  equals(otherPoint) {
    return this.#x === otherPoint.#x;
  }
}
```

Are you telling me that if `otherPoint` is a Point this function works, but if `otherPoint` isn't a point, then this just magically crashes. This means we are going to have runtime type checks for javascript properties in methods.

WAT!

So the reason we have `#` for private properties is to support functionality that no one needs or no one can understand like "well it would be confusing otherwise"


[Here is the official reasoning](https://github.com/tc39/proposal-class-fields/blob/master/PRIVATE_SYNTAX_FAQ.md#why-does-this-proposal-allow-accessing-private-fields-of-other-instances-of-the-same-class-dont-other-languages-normally-forbid-that)

I wish someone could explain that in layman's terms, because it sounds a lot like "Well Java allows that so we should too." Actually I don't know how many languages allow this, but I would inherently expect that this to be expressly forbidden. It isn't a public property, why should even other instances of the class have access to it.

Actually the rest of the "arguments on the github tc39 proposal don't even come close to justifying the reason for this. So it seems we will be stuck with this nonsense for no good reason.
Joining the DEV team ✅
Tags: meta, career, personal
Published: 2019-05-15 18:33:14


---
published: true
tags: meta, career, personal
---

Hey! If you follow the [DEV repository](https://github.com/thepracticaldev/dev.to) news closely, you may have noticed that I've been a part of the DEV team for a while now
Finally, it's time to introduce myself!

I'm a software developer from Northwest Russia, and I've been working in the industry for a decent amount of time already (since 2007).
I started as a full stack developer (php backend) but switched to Ruby a couple of years later (I love Ruby 💗).

At DEV I'm mostly focusing on refactoring, optimizations and overall code quality, however, I work on other things too.
It's a great experience to work on the opensource project fulltime. I would like to help others to contribute to the DEV codebase too. For now, you can join me on my [ActiveJob campaign](https://github.com/thepracticaldev/dev.to/issues/2497) if you're interested.

I'm passionate about lifelong learning, programming and helping others to learn and grow.  I'm also interested in writing and sharing my knowledge which I plan to do more of right here on DEV.
Being a part of the DEV team aligns well with my values and helps me to achieve my goals. I hope to bring value back to the community.

P.S. I have opened my DEV inbox, and I'm available for a quick chat on the dev topics.
I'm joining the DEV team
Tags: meta, career, personal
Published: 2019-05-15 18:32:12

---
published: true
tags: meta, career, personal
---

Hi everyone, you've probably seen my name popping up around the website or the [GitHub repo](https://github.com/thepracticaldev/dev.to). 😆 

I'm a software developer from Italy.

I've been loving this community for a while now and thanks to the DEV team I now have the opportunity to help out, in an official capacity, remotely and from this side of the Atlantic Ocean.

I have only been here two days and the greatest thing is that the team is exactly like I imagined them to be after years of participating in the community. 💙

I've never worked on a public website that's also open source so I can't wait for the first time I'll be able to break the build "from the inside". 😬

I hope to learn far and wide and I'm currently working on a not so secret feature.

My connect inbox is open 😀
Pushing Left, Like a Boss — Part 5.2 — Use Safe Dependencies
Tags: appsec, tutorial, beginners, security
Published: 2019-05-15 18:30:43

---
title: Pushing Left, Like a Boss — Part 5.2 — Use Safe Dependencies
published: true
description: The 5th section of this series details various examples of secure coding.
series: Pushing Left Like a Boss
tags: appsec, tutorial, beginners, security
---

###[This series, and my blog, have moved! ](https://wehackpurple.com/5-2-safe-dependencies/)!


According to many sources between [70–90%](https://techbeacon.com/13-tools-checking-security-risk-open-source-dependencies-0) of application code is contained within libraries and other 3rd party components. When we use libraries, frameworks and other 3rd party components, we are accepting all of the risks that come with them (including vulnerabilities). Luckily for us, when security researchers find security vulnerabilities in products (including libraries, frameworks and other components) they often report them to [Mitre](https://www.mitre.org), who log them in the [Common Vulnerability Enumerator (CVE) database](https://cve.mitre.org), a publicly searchable database containing all publicly-disclosed known vulnerabilities (note below). Using the CVE database either manually or (preferably) through use of an automated tool, to verify if your application is using known-vulnerable components is a key strategy to improve the security of your custom-built applications. There are *many* free and premium tools on the market (listed below), and I would suggest that you use at least one of them to ensure that the 3rd party code you are using is safe.


####<rant>
#####Automating this should be part of every CD/CI pipeline. You should also automate scanning of your source code repository on a regular basis. Everyone should do this, for every project, no matter how small. It’s so easy, and it’s such a huge win for the security of your applications, there is no excuse not to do it.
####</rant>

###[Read the rest of this article on my NEW blog!](https://wehackpurple.com/5-2-safe-dependencies/)!
Python generate Birth date ( Quiz )
Tags: beginners, python, pythonbeginner
Published: 2019-05-15 18:23:00

---
title: Python generate Birth date ( Quiz )
published: true
description: Quiz
tags: #beginner #python #python-beginner
---

Today After end of work as Pizza Boy ( As delivery guy / call [GrabBike](https://www.grab.com/th/en/bike/). So i'm sitting front of my laptop found my follower in twitter talking about "function to Generate birth date" as quiz. 

Then i try to solve this simple quiz with my self got it with 2 version one use of yield and second use more with lambda. 

### Version 1.

I use datetime function to limit current year then use [random()](https://docs.python.org/2/library/random.html) with randrange method to get number from range that i limit it in [range() function](https://pynative.com/python-range-function/).  

```python
import random
from datetime import datetime


def genDateOfBirth(number=1):
    CurrentTime = datetime.now()
    Year = random.randrange(1911, CurrentTime.year)
    for item in range(number):
        yield random.randrange(1911,CurrentTime.year), random.randrange(1, 12), random.randrange(1, 31)

dateTimeThatIwant = genDateOfBirth(12)

for year, month, date in dateTimeThatIwant:
    print("GenDate in yyyy-mm-dd  as %s-%s-%s" % (year, month, date))

```

### Version 2.

However, I have some question that 

* Can i refactor my code shorten ?. 
* Can i specify start year of computer usage that python use ?.

So got it use [lambda](http://book.pythontips.com/en/latest/lambdas.html) and [list-comprehension](https://www.pythonforbeginners.com/basics/list-comprehensions-in-python) compound.

```python

import random
from datetime import datetime
from time import gmtime

# gmtime(0) you will get epoch first year = 1970 
# read more -> https://en.wikipedia.org/wiki/System_time 
 
startYear = gmtime(0)
CurrentYear = datetime.now()

dateTimeGeneratorList = lambda numberOflist : [(yield random.randrange(startYear.tm_year, currentYear.year), random.randrange(1,12), 
random.randrange(1,31)) for item in range(numberOflist)]

# 12 if number of list that we need to printout .

for year, month, date in dateTimeGeneratorList(12):
   print("%s-%s-%s " % (year, month, date))

```

## Done!!  But, Can i make it better ? :) 
    
![](https://thepracticaldev.s3.amazonaws.com/i/s310pzvcb6k43o63o6cp.png)
Firebase React Authentication Tutorial For Beginners - Private Route With Hooks
Tags: firebase, react
Published: 2019-05-15 18:12:58

---
title: Firebase React Authentication Tutorial For Beginners - Private Route With Hooks
published: true
description: Sometimes you just need to make a fast prototype and you don’t want to mess with back end, authentication, authorization and all of that. Here is where Google’s firebase can help you. In this tutorial I’ll show you how to connect your react app with Firebase authentication module.
tags: Firebase, React
cover_image: https://thepracticaldev.s3.amazonaws.com/i/uvrwuh66fspf6rxm5rsk.png
series: React Firebase
---

Sometimes you just need to make a fast prototype and you don’t want to mess with back end, authentication, authorization and all of that.

Here is where Google’s firebase can help you.

In this tutorial I’ll show you how to connect your react app with Firebase authentication module.

It is Javascript tutorial for beginners. We are using React with hooks, React Router, React Router Dom and Firebase.

We’ll use Firebase Authentication module to handle login/sign up and React router to manage routing.

Code for this tutorial: https://github.com/satansdeer/react-firebase-auth
Discord Server: https://discord.gg/KPh8Vvb
Free React Testing Checklist: http://eepurl.com/c_8tzP

Subscribe to the channel: http://bit.ly/2QZ2UY3
Copy Your Modified Files in Git with 1 line
Published: 2019-05-15 17:29:33

---
title: Copy Your Modified Files in Git with 1 line
published: true
description: 
tags: 
---

For one reason or another, I occasionally find myself in a place where I want to copy off all my modified files in my local git repository and start over.  This is usually due to painful merges where I just want a fresh start.  This is the one-liner you can use to do just that: 


`git status --porcelain=v1 | awk {'print $2'} | xargs -I {} cp -r {} ../dir_with_changed_files`

Let's break down each part of this line in detail.

`git status --porcelain=v1`

You may be familiar with `git status`, adding the `--porcelain=v1` flag just changes the output from this:

![git status image](https://thepracticaldev.s3.amazonaws.com/i/m63dzy3ancw1yjvl3sl0.png)

to this:

![git status porcelain image](https://thepracticaldev.s3.amazonaws.com/i/kg7ivlac3c9zqjrerkav.png)


`awk {'print $2'}`

This awk command will print the 2nd column of [standard out](https://linux.die.net/man/3/stdout) (i.e. what is printed on the screen).  In our case, this will print out the column with the file names from the previous `git status --porcelain=v1` command.

`xargs -I {} cp -r {} ../dir_with_changed_files`    

This portion of the command utilizes the [xargs](http://man7.org/linux/man-pages/man1/xargs.1.html) tool which allows iteration over things coming from standard input.  In this case, standard input for the `xargs` command is the standard output from the previous `awk` command.  Which take the list of files and copies it to the `../dir_with_changed_files` directory.
What book should I read next? 🤔
Tags: books, learning, reading, advice
Published: 2019-05-15 17:27:59

This year I set my reading goal to 5 books, I have already read 2 so far:

* [Clean Code: A Handbook of Agile Software Craftsmanship](https://www.goodreads.com/book/show/8114501-clean-code)
* [The Clean Coder: A Code of Conduct for Professional Programmers](https://www.goodreads.com/book/show/10284614-the-clean-coder)

I have a whole list of [want to read](https://www.goodreads.com/review/list/82621539-glenn?shelf=to-read) books but instead of choosing one myself I thought it might be fun to let you guys decide what book I should read.

DEV doesn't have polls (yet) so I made one on [Twitter](https://twitter.com/GlennCarremans/status/1128710570121867265), feel free to retweet 😄
{% twitter 1128710570121867265 %}

The options are:

* [The Pragmatic Programmer: From Journeyman to Master](https://www.goodreads.com/book/show/22250228-the-pragmatic-programmer)
* [Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future](https://www.goodreads.com/book/show/22535480-elon-musk)
* [Hackers: Heroes of the Computer Revolution](https://www.goodreads.com/book/show/9426890-hackers)
* [The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution](https://www.goodreads.com/book/show/21943368-the-innovators)

**Also looking forward to any other suggestions in the comments!**

___

I would also like to share that I am trying to get Goodreads liquid tags on DEV but for that Goodreads first need to add embeds to their website: [Feature request](https://www.goodreads.com/topic/show/19711409-embed-book-info)

I think books are an important resource to devs and that adding a Goodreads liquid tag to DEV would make it a lot easier to share among each other.

___ 

*Feel free to follow me on Twitter [@GlennCarremans](https://twitter.com/GlennCarremans) or Goodreads [@Glenn](https://www.goodreads.com/user/show/82621539-glenn)*