teleren/devto huggingface dataset:
How To Get Dark GNOME Shell Menus And Dialogs On Ubuntu 20.04 Focal Fossa With Yaru Theme
Tags: ubuntu
Published: 2020-04-29 12:05:30

Ubuntu 20.04 uses a mixed light and dark GTK theme by default (Yaru), with light and dark alternatives available in `Settings -> Appearance`. The default GNOME Shell theme (the menus used for the top panel and Ubuntu Dock, and system dialogs) is light / white by default, and stays that way even when changing the GTK theme to Yaru-dark.

One of the first things I did after installing Ubuntu 20.04 was to change this GNOME Shell theme to its dark variant, and in this post I&#39;ll show you how to do it.

*About that. In case you want to see a list of top things to do after installing Ubuntu 20.04 LTS Focal Fossa, check out [this](https://www.linuxuprising.com/2020/04/top-things-to-do-after-installing.html) article. It has information on how to tweak the Ubuntu Dock, how to change the GTK/Shell theme based on the Night Light schedule (so the theme changes to dark too when switching to night mode), fix the ugly default style of Qt5 applications under GNOME Shell, how to enable flatpak and install flatpak apps using the Software tool, and much more.*

**Changing the GNOME Shell theme is a bit trickier than changing the GTK theme**. You&#39;ll need to install GNOME Tweaks app and the User Themes extension (part of the `gnome-shell-extensions` package which contains the default/official GNOME Shell extensions) to be able to do that. Install these by using the command that follows:

```
sudo apt install gnome-tweaks gnome-shell-extensions
```

After installing these 2 packages, restart GNOME Shell. To do that in the default Ubuntu 20.04 X11 session just press `Alt + F2`, type `r` and then press the `Enter` key. If you&#39;ve switched to the Wayland session, you&#39;ll need to logout and relogin.

![GNOME Tweaks Ubuntu 20.04 Yaru-dark Shell theme](https://dev-to-uploads.s3.amazonaws.com/i/2dvfeejndq3aiofmov5a.png)

Next, open Tweaks and under `Extensions` enable the `User themes` extension. Close, and relaunch Tweaks (without this you still can&#39;t change the GNOME Shell theme), and under `Appearance` you&#39;ll be able to change the Shell theme to Yaru-dark, as shown in the screenshot above.

This is the default Ubuntu 20.04 GNOME Shell theme:

![Ubuntu 20.04 light gnome shell theme](https://dev-to-uploads.s3.amazonaws.com/i/pifvfk7s9104tze9i7uo.png)

After making the change suggested in this article, Ubuntu 20.04 Focal Fossa will use a dark GNOME Shell theme:

![Ubuntu 20.04 dark gnome shell theme](https://dev-to-uploads.s3.amazonaws.com/i/3tjb5jw11tonxxllblyk.png)
Daily Developer Jokes - Wednesday, Apr 29, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-04-29 12:00:24

---
title: "Daily Developer Jokes - Wednesday, Apr 29, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Wednesday%2C%20Apr%2029%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258a3e5534.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Why did the developer ground their kid?

___A:___ They weren't telling the truthy
 -->
A mutable react state management container react-tyshemo
Tags: react, statemanagement
Published: 2020-04-29 11:46:03

---
title: A mutable react state management container react-tyshemo
published: true
description: Introduce a react state management container named react-tyshemo which is easy to use.
tags: react, state management
---

You may use react-redux for a long time, now, try a new state management container.

```js
import { use } from 'react-tyshemo'

// register a state space
use({
  name: 'statenamespace',
  
  state: {
    name: 'xxx',
    age: 10,
  },

  methods: {
    updateAge(age) {
      this.age = age
    },
  },
})
```

```js
import { connect } from 'react-tyshemo'

function MyComponent(props) {
  const { name, age, updateAge } = props
  return <span onClick={() => updateAge(age + 1)}>grow</span>
}

const mapToProps = (state, methods) => {
  return {
    ...state.statenamespace,
    ...methods.statenamespace,
  }
}

const mergeToProps = (mapProps, ownProps) => {
  return {
    ...mapPorps,
    ...ownProps,
  }
}

export default connect(mapToProps, mergeToProps)(MyComponent)
```

Embrace mutable state, make things easy.

```js
import { connect } from 'react-tyshemo'

function MyComponent(props) {
  const { some } = props
  return <span onClick={() => some.age ++}>grow</span>
}

const mapToProps = (state) => {
  return {
    some: state.statenamespace,
  }
}

export default connect(mapToProps)(MyComponent)
```

Notice the sentence `some.age ++`, it will trigger rerendering.

[Read more about react-tyshemo.](https://github.com/tangshuang/react-tyshemo)
Shocking Way Agile Web Development Process Will Make You Better in Bed
Tags: agile, startup, webdev
Published: 2020-04-29 11:32:46

Many factors make sex so much better. The tidiness of the surrounding space, the atmosphere built from music, long conversations, or a foreplay game with long caresses is something that elevates sex to a higher level.

But if you move on to the technical aspects, there is one aspect that makes lovers feel amazing, it makes sex great, and gives the desired excitement. If lovers take care of it, you don't have to ask "did you like it?" after all. It is clear to both of them that they liked it, no questions asked.

This secret technique is... RHYTHM. Let me tell you today why it has a lot to do with agile web development.

I have the impression that despite the incredible popularity of the agile web development process, a large part of the Web World so Wide is lost somewhere between Waterfall and Agile.

Cascading/Waterfall approach is criticized by everyone who praises the benefits of the Agile web development process - so literally by everyone in the software development world. However, many do not know how to work in Agile, even though they say they do. Same as with young lovers!

Someone told them: work in Scrum, beware of Waterfall! So they have been watching courses, reading the Scrum Guide, and they're rightly trying to convince (or sometimes force) everybody to daily meetings thinking that it's all about them. Well, yes and no.

The issue is that nobody told them what the purpose behind these recurring meetings and practices are.

Everything boils down to the RHYTHM that the whole team set up and follow, and Agile events just facilitate it.
So you can be flexible with it, just like during bedtime! As long as the team has a rhythm, you can adjust each piece of your agile web development process.

You don't have to force having meetings just because Scrum Guide told you to have daily standups when there's no rational reason to have them so often.

As a result, everyone is stuck in the middle of nowhere, having unrhythmic work and an undetermined web development workflow.

It's a bit like with lovers who know what to do, but how - it's a mysterious art. It is only the possession of knowledge about RHYTHM that determines success and satisfaction.

If you look at it that way, you'll find it easier to understand and implement Agile, convince others to its ceremonies, and achieve success with your project.

Just like in sex, the rhythmic work will lead your sprints to full success!

What can you do in practice? Repeat to your development teams every day that the Agile development process is about rhythm. Let that word be like a mantra. You can set up a Google Calendar with recurring events that set that rhythm for everyone. And last but not least, be flexible with it - as it is the team that constitutes the rhythm, not a Scrum book you've been reading, or the recurring meetings schedule you agreed to host two months ago.

Maybe you didn't know that sex is all about rhythm? If not, this article will help you in two important areas of private and professional life! ;
Release @nxtend/ionic-react 2.0.0
Tags: ionic, react, nx, webdev
Published: 2020-04-29 11:31:30

---
published: true
title: "Release @nxtend/ionic-react 2.0.0"
cover_image:
description: "Bugs have been fixed, dependencies have been updated, and even Ionic has made updates to their starter templates"
tags: ionic, react, nx, webdev
series:
canonical_url:
---

I have been hard at work on `@nxtend/ionic-react` since the initial relese, and I'm happy to announce that version 2.0.0 is now available. Bugs have been fixed, dependencies have been updated, and even Ionic has made updates to their starter templates.

## Features

- extend `@nrwl/react` schematics
- import `@testing-library/jest-dom` commands for unit tests
- upgrade `@testing-library/jest-dom` to 5.5.0
- upgrade `@testing-library/cypress` to 6.0.0
- upgrade `@testing-library/user-event` to 10.0.1
- honor `unitTestRunner` flag
- set `@nxtend/ionic-react` as the default collection if one is not set when generating an application
- honor `skipFormat` flag
- update Ionic starter template
  - [#1201](https://github.com/ionic-team/starters/pull/1201)
  - [#1202](https://github.com/ionic-team/starters/pull/1202)
  - [#1237](https://github.com/ionic-team/starters/pull/1237)

I originally used the same dependency versions that ship with Ionic, however, several of them were getting rather out of date. I decided to update all of the `@testing-library/*` dependencies and will continue to maintain those updates with future releases.

Ionic React ships with `@testing-library/jest-dom` configured, and while `@nxtend/ionic-react` shipped with the dependency, it was not actually being used in v1.0.0. This library will now be configured for all `@nxtend/ionic-react` applications going forward.

The Ionic team have made several minor revisions to their starter templates, and this has been reflected in this project. If you would like to incorporate these changes then feel free to look at the [migration guide](https://github.com/devinshoemaker/nxtend/blob/%40nxtend/ionic-react%402.0.0/libs/ionic-react/MIGRATION.md) provided.

I extended the `@nrwl/react` schematics so that all `generate` commands fallback onto that plugin. Essentially, even though `@nxtend/ionic-react` does not have a `component` schematic, you can still generate one with this plugin since `@nrwl/react` has one available. The plugin also now sets `@nxtend/ionic-react` as the default schematic if one is not yet set.

Due to the breaking changes in the `@testing-library/*` dependencies, extending the `@nrwl/react` schematics, as well as the changes to default schematics, it warranted a major release.

I have a number of features plannned for upcoming releases and I can't wait to share it with you all. Feel free to reach out to me on Twitter if you have questions or anything else!

# Resources

nxtend GitHub: https://github.com/devinshoemaker/nxtend<br>
NPM Package: https://www.npmjs.com/package/@nxtend/ionic-react<br>
Nx: https://nx.dev<br>
Ionic Framework: https://ionicframework.com
Caution! Disaster ahead, use Me Time
Tags: management, growth, leadership, improvement
Published: 2020-04-29 08:59:12

After getting promoted, people usually get lot’s of additional communication to be a part of. Lot’s of new responsibilities, meetings, decisions and approvals. This can be overwhelming, or worse, addictive.

One’s managerial leverage increases as the person goes up in the organization hierarchy. This is a double-edged sword. As described by Andy Grove in [High Output Management](https://www.amazon.com/High-Output-Management-Andrew-Grove/dp/0679762884), using this leverage positively can increase the organizational output dramatically. If the same leverage is used negatively (delayed decisions or unnecessary interruptions), it will result in dramatic decrease in organizational output i.e. a disaster.

How to make sure that you are not leading yourself and your team/organization to the path of disaster? Use Me Time. It’s a chunk of time that you dedicate for a one-on-one with yourself. This is necessary for you if you want to

* Measure and increase your organizational effectiveness
* Explore your passions and talents
* Move out from the level of your incompetence (Peter’s principal)
* Move your focus from problems to opportunities
* Be Less Reactive and More Proactive
* Move out from circle of concern to circle of influence
* Spend your day with resolution instead of confusion and distraction


## What should one do in ME TIME
* Create a vision for your life if you don’t already have one. Now regularly measure your progress towards it.
* Categorize your tasks in four quadrants of time management matrix. Now try to achieve the target time allotment for each quadrant.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xbp3rgzz6vh8o99wdpvx.jpeg "Image credit http://www.mattcole.us")

* Maintain your daily, weekly and year to-do lists.
* Create a list of work related tasks you performed recently and sort them according to the managerial leverage ( i.e. Maximum impact and output in minimum time). Now try to increase the high leverage items in your daily schedule.
* Maintain daily journals. It’s a great way to manage oneself. Daily journaling is not limited to making a list of tasks you did or want to do during the day. It should include your thoughts and emotions. Things like what is making you happy, were you able to inspire someone today, did you learn something new? Writing these down is the first step towards controlling your emotional self.

Me Time is a routine with astonishing fruits and an equally astonishing process. A lot of patience and practice will be needed to become the master of me time. Concepts are listed with a very brief summary above. you’ll have to further read about them. There’s tons of material available about them in different formats. Once you cross the initial blocker of habit building, you’ll discover that it’s the greatest gift you have given to yourself.

> Every next level of your life will demand a different you.
Bottom drawer tutorial
Tags: angular, react, typescript, javascript
Published: 2020-04-29 08:59:02

### Leadership UI
Let's make a quick look up on most modern and famous applications: 
- *Apple Music, Apple Maps, Apple Stocks, Google Maps, Asana, Facebook, Slack and others...*

No doubts - these all are leaders in mobile user interfaces. Within revolutionary technologies, new revolutionary interfaces appears, with new components, to maintain these techs.

### Revolutionary components
In meantime the most demanded revolutionary component is `Bottom drawer`. 
`Bottom drawer` becomes the main control element of interfaces in mobile applications.

<img src="https://raw.githubusercontent.com/roman-rr/cupertino-pane/master/docs/images/3.gif" width="170px">

Pretty obviously: Hybrid, progressive and web application developers needs own `Bottom drawer` solution in a web and cordova apps. 


### Requirements and package description
In the next example we will use [Cupertino Pane](https://github.com/roman-rr/cupertino-pane)

> *Cupertino Pane* is great modern slide-over pane with touch technologies.
Lightweight, Multiplatform, Open Source. For progressive applications.

Package is perfectly fit for React/Angular/Vue cases, but all javascript frameworks are supported out of the box. 

### Getting Started
Install via NPM
```bash
npm install cupertino-pane --save
```

Add HTML Layout
```html
<div class="cupertino-pane">
    <h1>Header</h1>
    <div class="content">Content</div>    
</div>
```

Initialization
```javascript
import { CupertinoPane } from 'cupertino-pane';

const drawer = new CupertinoPane('.cupertino-pane', { /* ... */ });
drawer.present({ animated: true });
```

### Conclusions
Simple package make new generation component ported from native to web and javascript world. That's pretty easy to use it!
SuperPyOS- the security
Tags: python, linux
Published: 2020-04-29 07:52:23

# stopping piracy one step at a time...

well not really.

----------

further down the line, we realised after pushing to github that people would poke around at our code. Find vulnerabilities and send pirate copies of the system to others

> YES I KNOW IT'S OPEN SOURCE! BUT YOU NEED TO BE PREPARED!

--------

# step 1. the name

We needed a name that sounded professional but friendly, in the end we settled for the name EN_LICE_ULOCK. It was a bad name but we didn't have a lot of time.

# step 2. the code

There needed to be a way to stop execution on startup if something was missing, licelock 1.0 looked like this:

```python

import os
import sys
import logging
from datetime import datetime
from time import *

f = open("LICENSE.txt", "r")
```
it was bad, really bad...

all it does is look for a LICENSE.txt file, and python throws the tantrum when it can't be found, we needed to change and fast.

# step 3. securing further and the API

First, we needed to change the way licelock works...

1. instead of putting it in the main code, we turn it into a module and ship with every copy.

2. change what it looks for, or at least seperate into levels of protection.

3. get the update out fast.

-----------

so our new proccedure worked like this:

```python    
def keylock():
    from base64 import (
        b64encode,
        b64decode,
    )

    from Crypto.Hash import SHA256
    from Crypto.Signature import PKCS1_v1_5
    from Crypto.PublicKey import RSA


    message = "Validated"
    digest = SHA256.new()
    digest.update(message)

    # Read shared key from file
    private_key = False
    with open ("superpy.pem", "r") as myfile:
        private_key = RSA.importKey(myfile.read())

    # Load private key and sign message
    signer = PKCS1_v1_5.new(private_key)
    sig = signer.sign(digest)

    # Load public key and verify message
    verifier = PKCS1_v1_5.new(private_key.publickey())
    verified = verifier.verify(digest, sig)
    assert verified, ("Signature verification failed")
    print("Successfully verified signature, booting...")
    os.system("python3 boot.py")
```

look for secure keys instead of editable text files!

just for ref- the keys are generated through openSSL:

```python
openssl genrsa -out private_key.pem 1024
```

now with that sorted, we needed to import it into the code. We saved it as licelock.py and in our main file we added-

```python
import licelock

licelock.keylock()
```

and there we go, a simple but secure mechanism that shuts off the script if there isn't a key. I WOULD NOT use this in production if I was you!
Undine v0.2.0 released
Tags: ruby, rubygems
Published: 2020-04-29 10:52:06

---
title: Undine v0.2.0 released
published: true
description:  automatically googling with error message of exceptions unrescued by your code.
tags: 
 - ruby
 - rubygems
---

When developing, sometimes you might run your code to check how it works.
At that time, you might see an exception you didn't expect before. 
What's next?
If I were you, I would google with the error message to find blog posts and documents dealing with the exception.
You too?

Today I released new version of Undine :tada: : `Undine` adds a termination process at exit to open google search with error message of exception unrescued in your Ruby code.

{% github satoryu/undine %}

## Installation

```sh
gem install undine
```

Or if your app uses bundler add the following line to Gemfile:

```ruby
gem 'undine', group: :development
```

## Usage

`Undine.load` registers a process to be executed at exit.
The process checks existence of exception unrescued in your code and open your browser to google with message of the exception as keyword.

Here is sample code:
```ruby
require 'undine'

Undine.load

def something_function
  'hoge'.foo
rescue => e
  warn e.message
  raise e
end

something_function
```

In this code, `something_function` raises `NoMethodError` and the exception is not rescued.
The process registered by `Undine.load` catches it and generates a query from the exception object, in default, just calls the exception's `message`. 
The query is as follows:

- https://www.google.com/search?q=undefined+method+%60foo%27+for+%22hoge%22%3AString%0ADid+you+mean%3F++for

## Welcome Bug reports, feature requests and pull-requests!

I'm going to welcome any issue and pull-request :+1:
Please open new issue or pull-request at [the repo](https://github.com/satoryu/undine/issues/new/choose).
how to get max from array of object of same id in javascript
Tags: javascript, angular
Published: 2020-04-29 10:45:17


I have an array of object like this:

[
    {
        consultant_fname: "Aleah"
        consultant_lname: "Johnson"
        service_name: "Academic Support"
        session_scheduled_datetime: Fri May 24 2019 10:28:00 GMT+0530 (India Standard Time) {}
        status: 2
        student_fname: "mathew"
        student_lname: "wade"
        subject: "English"
    },

    {
        consultant_fname: "Erica"
        consultant_lname: "DaRosa"
        service_name: "Academic Support"
        session_scheduled_datetime: Wed May 29 2019 17:50:00 GMT+0530 (India Standard Time) {}
        status: 2
        student_fname: "Jim"
        student_lname: "Holmes"
        subject: "Spanish"
    },

    {
        consultant_fname: "Aleah"
        consultant_lname: "Johnson"
        service_name: "Academic Support"
        session_scheduled_datetime: Fri May 24 2019 10:33:00 GMT+0530 (India Standard Time) {}
        status: 2
        student_fname: "mathew"
        student_lname: "wade"
        subject: "English"
    },      

    {
        consultant_fname: "Aleah"
        consultant_lname: "Johnson"
        service_name: "Academic Support"
        session_scheduled_datetime: Fri Oct 18 2019 22:08:00 GMT+0530 (India Standard Time) {}
        status: 2
        student_fname: "Sir"
        student_lname: "Knowles"
        subject: "Physics"
    },

    {
        consultant_fname: "Aleah"
        consultant_lname: "Johnson"
        service_name: "Academic Support"
        session_scheduled_datetime: Wed May 29 2019 18:22:00 GMT+0530 (India Standard Time) {}
        status: 2
        student_fname: "Dorris"
        student_lname: "Morgan"
        subject: "Physics"
    },

    {
        consultant_fname: "Aleah"
        consultant_lname: "Johnson"
        service_name: "Academic Support"
        session_scheduled_datetime: Fri Oct 18 2019 21:21:00 GMT+0530 (India Standard Time) {}
        status: 2
        student_fname: "Sir"
        student_lname: "Knowles"
        subject: "Physics"
    },              
]
from this array how can i add get the max date from particular 'student_login_fname' for eg. in this array 'mathew wade' and 'sir knowles' has multiple data from that data how can I get the last date of 'mathew wade' and last date of sir 'knowles'?
User creation and first access
Tags: security, pattern, develop, bestpractice
Published: 2020-04-29 10:44:14

Hi, I am developing a web app for my customer with many access profiles. One of these is the customer administrator profile that can create other users. When the admin creates a new user a mail is sent to this user (at the address that the admin has set) and so the new user can access for the first time. At now, in the mail, it was specified a temporary password that the user must be changed at the first access. 

It is safe in your opinion? Is it possible to improve this process, without any generated password with a generated link and is this better or safer?

I haven't found a specific pattern to follow or OWASP documentation, so if you know a good doc or article please let me know.