teleren/devto huggingface dataset:
Enabling Quake Mode on Windows Terminal
Tags: opensource, productivity, terminal, beginners
Published: 2021-05-26 03:59:10

---
title: Enabling Quake Mode on Windows Terminal
published: true
description: We'll investigate how to enable Quake Mode on Windows Terminal
tags: opensource, productivity, terminal, beginners
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3pl25bzd58xhpnqresf.png
---

Hello everyone, 

I just got my hands on the new Windows Terminal preview and wanted to share how to enable "Quake Mode" which allows you to open a new terminal instance from anywhere in Windows by pressing the Win + ` key. 

You must be using the latest version of Windows Terminal Preview.  

Just place this code in your "actions" section: 

{ "command": { "action": "globalSummon", "name": "_quake", "dropdownDuration": 200, "toggleVisibility": true, "monitor": "any", "desktop": "toCurrent" }, "keys": "win+`" },


Read the [docs](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#global-commands) for more information on the Global Commands that you can use.

Or you can watch the video below and hopefully you'll find it helpful! 

Video (6 mins)
{% youtube vVy8XnDnslU%} 

Conclusion

Feel free to checkout my [Twitch streams](https://twitch.tv/mbcrump) as we learn about security and app development or you can watch the condensed version of all of my streams by subscribing to my [YouTube](https://youtube.com/mbcrump). 

Stay connected with me on social platforms for daily software development news.

-[Twitter](https://twitter.com/intent/follow?screen_name=mbcrump) | [Twitch](https://twitch.tv/mbcrump) | [Instagram](https://instagram.com/mbcrump) | [YouTube](https://youtube.com/mbcrump) | [GitHub](https://github.com/mbcrump) | [Website](https://www.michaelcrump.net)
html css and jquery hamburger menu responsive
Tags: todayilearned, html, css, codenewbie
Published: 2021-05-26 03:53:22

Hey folks,

I'm back again with another exciting project. In this post we will learn how to make burger menu with just simple HTML, CSS and 4-5 lines of JQuery.

First of all create 3 files give them name as follows
1 - index.html
2 - style.css
3 - script.js

then import JQuery CDN link in your head area of html file

`<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" ></script>`

Now your HTML file will look like similar to this one

![burger HTML](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/brk08lw2yzzl60vlgyua.png)

ok so this is the major mistakes newbies do in their projects, they forget to import CDN in their projects.

Now if you know little bit about HTML and CSS you can make it by your own.

Because explaining each and every line of code will be more lengthy post.

But if you are not comfortable with HTML and CSS you can join this Highly rated course hosted on Eduonix.

[![CSS course eduonix](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/az71k2lp2eeyll27izng.png)](https://www.eduonix.com/css-bootcamp-master-in-css-including-css-grid-css-flexbox/UHJvZHVjdC0xMzE1MDIw)

for jquery part of this project

![jquery](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h5e8tmj3nl2dnqz3tdyd.png)

This is just simple jquery function which is trying to say that when `btn` Burger button is clicked change this two class to another two classes which is as follows.

.btn  ==  .close-btn
.menu ==  .open-menu

Hope you are understand everything along this far, Now i highly recommend you to play with this codepen project.

It will help you to clear your concepts.

{% codepen https://codepen.io/atulcodex/pen/BaWZBpV %}

[![Atul - Buy Me A Coffee](https://media.giphy.com/media/513lZvPf6khjIQFibF/source.gif)](https://www.buymeacoffee.com/atulcodex)
Fix Drupal's "Failed to get available update data" error on Available updates
Tags: drupal, update, security, troubleshooting
Published: 2021-05-26 03:50:27

## Summary

That short made me really troubled meanwhile😅

---

### Environment

- OS: [OpenBSD](https://www.openbsd.org/) 6.9
- Web: OpenBSD [httpd](https://man.openbsd.org/httpd.8)
- App: [PHP](http://php.net/) + [PHP-FPM](https://www.php.net/manual/en/install.fpm.php) 
- CMS: [Drupal](https://www.drupal.org/) 9

---

I have installed Drupal 8/9 on OpenBSD several times.

Drupal admin panel has the function to look up "Available updates" in "Report" pages.
I was in trouble because it always failed after those installations.

![Failed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/avr9uycth4hetllggba0.png)

<center>Fig.1 Failed</center>

## Solution

I found it was because of TLS connection failure, after struggling and being empowered by the official documentation:

- [Drupal - PHP OpenSSL requirements](https://www.drupal.org/docs/system-requirements/php-openssl-requirements) 

To fix it, place `cacert.pem` under [`chroot`](https://man.openbsd.org/chroot)'s root and configure PHP aka `php.ini`.

First, get the certificate.

```console
$ # /etc in `chroot` is `/var/www/etc` in actual
$ cd /var/www/etc

$ doas mkdir ssl
$ cd ssl

$ # get the cacert.pem
$ doas ftp https://curl.haxx.se/ca/cacert.pem
$ doas chmod a-w cacert.pem
```

It looks like:

```console
$ pwd
/var/www/etc/ssl
$ ls -l
total 448
-r--r--r--  1 root  daemon  206919 Apr 13 12:12 cacert.pem
```

Then, edit `php.ini`.

```console
$ doas nvim /etc/php-7.4.ini
```

to add the line:

```diff
  [curl]
  ; A default value for the CURLOPT_CAINFO option. This is required to be an
  ; absolute path.   
  ;curl.cainfo =
+ curl.cainfo = "/etc/ssl/cacert.pem"
```

Finally, restart the PHP-FPM daemon.

```console
$ doas rcctl restart php74_fpm
```

## Conclusion

Happily, my site got the update information🙂

![Successful](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kxyq3kmrezv2d9h4f5kx.png)

<center>Fig.2 Successful</center>
Cheatsheet for the Regex Cheatsheet, Part VIII: Pattern Modifiers
Tags: beginners, javascript
Published: 2021-05-26 03:39:42

##Intro
I was recently doing a code challenge for a job interview that required me to strip out all nonalphabetic characters. "Ah! I should use Regular Expressions for this!" I thought in triumph, impressed that I even knew what regular expressions _were_. That fleeting moment of glory faded once I decided to brush up on regular expressions and landed on the encouragingly-named [Regular Expressions Cheatsheet](https://cheatography.com/davechild/cheat-sheets/regular-expressions/). I had no idea how to use it!

So, for people like me, here is a *Cheatsheet for the Regex Cheatsheet, Part VIII: Pattern Modifiers*

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rdweg8wkwafvg1sdzkmq.png)

## What are Pattern Modifiers?
Pattern modifiers aka flags modify the behavior of the regex search you are performing. Again, this will be better understood through example, so read on! 

## Anatomy of a regular expression
1. Forward slashes go on either end like so: ``/``something``/``
2. Add ``g`` for "global" at the end to find every instance, like so: ``/``something``/g``
3. Add ``m`` to "multi line" to the beginning/end of each line, not just the beginning/end of each string, like ``/``something``/g`` or ``/``something``/gm``

## Pattern Modifiers

To illustrate pattern modifiers, let's revisit a regex from [Groups & Ranges](https://dev.to/mathlete/cheatsheet-for-the-regex-cheatsheet-part-vii-groups-ranges-32ne) where we are searching for vowels:

##### ``[xyz]`` Range of characters (``x`` or ``y`` or ``z``)
* ``[aeiou]`` is used in ``/[aeiou]/`` (with no modifiers) to find the the *only* first vowel:  

*A l<mark>i</mark>on roared*

---
##### ``g`` Global match: Continue searching after the initial match
* ``g`` can be added like this ``/[aeiou]/g`` to find *all* the lowercase vowels:  

*A l<mark>io</mark>n r<mark>oa</mark>r<mark>e</mark>d*

---
##### ``i`` Case Insensitive match
* ``i`` can be added like this ``/[aeiou]/gi`` to find all the lowercase *and uppercase* vowels:  

*<mark>A</mark> l<mark>io</mark>n r<mark>oa</mark>r<mark>e</mark>d*

---
##Dunce Corner

##### ``m`` Multiline
I don't get this. [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/multiline) says:

"...if "m" is used, ``^`` and ``$`` change from matching at only the start or end of the entire string to the start or end of **any** line within the string."

---
##### ``s`` Single line

*Maybe* this is explained in (this MDN Doc)[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/dotAll], but I still don't get it.

---
I don't think the following are supported in Javascript. Reach out in the comments in you know better.
##### ``x`` Allow comments and whitespace in pattern
##### ``U`` Ungreedy pattern
Hello, World!
Tags: flutterfyi, flutter, dart, programming
Published: 2021-06-11 13:25:50

---
title: Hello, World!
description: Welcome to my new website: https://flutter.fyi - follow me @flutterfyi for updates, or on dev.to/flutterfyi for discussions.
published: true
date: 2021-05-26 03:03:31 UTC
tags: flutterfyi, flutter, dart, programming
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8uhzowdyd82jv2nf8xhb.jpg
canonical_url: https://flutter.fyi/about/
---

Apparently my namesake Twitter account is celebrating a birthday today. So I thought I should do something special.

{% twitter 1403330833834983431 %}


Yep - I have a brand new [website](https://flutter.fyi) to share my (re)learning journey with Flutter and Dart, starting with Flutter v2.2. I want to keep it simple and focused - here are the two main themes I will explore:

---

### Development: Cross-Platform Apps

My earlier exploration of Flutter focused purely on mobile (Android/iOS) app development. My primary goal now is to revisit this in three contexts: 

 * `Language` | Build proficiency in Dart programming.
 * `Cross-Platform` | Frontend experiences across mobile, web, desktop
 * `Multi-Cloud` | Backend service integrations and tooling.

---

### Design: Multi-Screen & Foldable Devices

A secondary goal is to explore new _user experiences_ enabled by foldable and multi-screen affordances. I see 3 areas for exploration:

 * `Foldable Device, 1 screen`: Design for occlusion.
 * `Foldable Device, Dual screen`: Design for spanning, side-by-side.
 * `Multiple Devices`: Multi-screen 'coordinated' experiences.

The former will focus on devices like the Microsoft Surface Duo, while the latter will explore ideas around 'companion' experiences for a ecosystem of smart things (e.g., TV, Auto, Wearables) within the Android ecosystem.

---

Join me.
5/25 TIL: C++ basics (heap memory, referencing, pointer to struct)
Published: 2021-05-26 03:01:13

<strong>Heap Memory in C</strong>

- The heap is a large pool of memory that can be used dynamically - it is also known as the 'free store'. This is memory that is not automatically managed and you have to explicitly allocate & deallocate. It is where global variables are stored and you have whats called 'memory leak' if you fail to free/deallocate the memory.
- To assign memory in heap, we use malloc()
- You must delete (release/de-allocate) the memory in whenever you are dynamically allocating memory Ex) free(p) in C and delete [] p in C++ where p is an array

```

// allocates 20 bytes (5 * 4) of heap memory holding an int and assign that pointer to p

p = (int *)malloc(5 * sizeof(int));

free(p);

// C++

p = new int[5];

delete [] p;

```

- Every pointer takes 8 bytes of memory regardless of its data type

<strong>Referencing in C++ (only C++)</strong>

- Nickname/alias given to a variable

```

int a = 10;

int &r = a;

```

- Reference has to be initialized (it cannot just be declared)
- Now the variable a is also "called" r (this is not related to pointer)
- Useful in parameter passing

Ex)

```

// instead of having to pass pointers 

void swap(int *x, int *y) { ... }

int main() {

int a = 10; b = 20;

swap(&a, &b);

}

// we can use referencing; now we don't have to pass the pointers

void swap(int &x, int &y) { ... }

int main() {

int a = 10; b = 20;

swap(a, b);

}

```

<strong>Pointer to Struct</strong>

```

struct userInfo u={'david', 25};

struct userInfo *p = &u;

// this won't work bc the dot takes precedence

*p.name = 'davidd';

// instead wrap p inside brackets

(*p).name = 'davidd';

// OR

p → name = 'davidd';

```

<strong>Create an object dynamically in heap using pointer</strong>

```

// malloc returns a void pointer; so we typecast it 

p = (struct userInfo*) malloc(sizeof(struct userInfo));

```

<strong>Array as Parameter</strong>

- Arrays can only be passed by address; it cannot be passed by value at all (both C & C++)

```

// when we receive an array with square brackets, it can only be a pointer to the array 

void funcOne(int A[]) { ... }

// for this we have a pointer to an integer; it can point to any integer and even the array

void funcOne(int *A) { ... }

```
What is Null Safety Operator in PHP 8 and why is it next big thing in PHP
Tags: programming, php
Published: 2021-05-26 02:40:44

PHP is known to have a very bad reputation among developers because of its loose type system and weak technical design.
However with every new version, PHP is changing the perception of developers.
Recent improvements in PHP 7 and then PHP 8 brought many features that you would only see in languages like Java, C++, Dart etc.

One of those features/improvement brought by PHP 8 is easier Null Safety.

##### Null Safety has lot of significance in programming, as Program Crashes caused by Null Values are highly popular.

## What is Null Safety Operator:

![wondering](https://media.giphy.com/media/Xepskm6YoEEifd1rb7/giphy.gif)
Null-safe operator is a new syntax in PHP 8.0, that provides optional chaining feature to PHP.

The null-safe operator allows reading the value of property and method return value chaining, where the null-safe operator short-circuits the retrieval if the value is null, without causing any errors.

The syntax is similar to the property/method access operator (->), and following the nullable type pattern, the null-safe operator is ?->.
```php
$foo?->bar?->baz;
```

Null safe operator silently returns null if the expression to the left side evaluates to null.

```php
class Customer {
    public function getAddress(): ?Address {}
}
class Address {
    public function getCountry(): string {}
}


$country = $customer->getAddress()->getCountry();

```
In the snippet above, the Customer::getAddress() method return value is nullable; It can return a null value, or an object of Address class.

The $customer->getAddress()->getCountry() chain is not "null safe", because the return value of getAddress can be null, and PHP throws an error when it tries to call getCountry() method:
```php
Fatal error: Uncaught Error: Call to a member function getCountry() on null in ...:...
```

To safely access the address, it was necessary to check the null return values before further accessing the return value.

```php
$address = $customer->getAddress();
$country = $address ? $address->getCountry() : null;
$address = $customer->getAddress();
if ($address) {
    $country = $address->getCountry();
}
else {
    $country = null;
}
```
The null-safe operator solves this by short-circuiting the property/method access, and returning null immediately if the left side of the operator is null, without executing the rest of the expression.

### References:
[PHP 8 new Features](https://php.watch/versions/8.0).

![bye](https://media.giphy.com/media/QEIC6GZIEGStO/giphy.gif)


[Succeed in IELTS by Practicing English Speaking](https://mockready.com)
Open-sourced the API editor of my upcoming product
Published: 2021-05-26 02:33:47

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/txs03pih1vhm1ydgq4ab.png)

Hello developers :)

I'm working on my next product which is a collaborative API platform. The idea initially came from my daily works, I was working in a consulting agency that design & build apps for large companies like Nike, Starbucks, Burberry, etc.

Just like other digital teams, we use tools like GitHub, Jira, Figma to manage everything and work together. But as a backend dev, I found the management for the API is chaotic, we use websequencediagrams to draw sequence diagram, using lucidchart to draw some logic diagram and frontend colleagues have to use swagger-editor to check backend's API doc.

We don't have an all-in-one platform to manage everything in the backend. With the project going and become more complicated, it becomes hard for team members to review the logic designing behind each API, which is quite important for those performance-critical APIs. On the other hand, backend devs have to use Slack to notify the frontend team which API has just been changed.

So I started to build a collaborative API platform aim at bringing frontend & backend teams to work together in one place. The product is going to be released in the next month and I just open-sourced the openAPI editor of the product, it might help if you are looking for an alternative of swagger-editor.

Github: https://github.com/chilllab/comet

Happy creating :)
Identity Access Management (IAM)
Tags: aws, cloudpractitioner
Published: 2021-05-26 02:12:30

# Identity Access Management

* Global - no need to specify a region
* Once created, this is applicable GLOBALLY.

## 3 ways to access AWS Console

1. Console
2. Programmatically (was-cli)
3. SDK

## Root Account

* Email address used to setup the AWS account
* Has full administrator access
* Secure with Multi-Factor Authentication
* Create users for each individual for your organisation

## Group

* Store your users
* Could apply policy to a group
* Members of that group get the same access

# IAM Best Practices

## Root Account
* Do not use for login
* Create a “working account”

## MFA
* Always enable

## Users
* One user = One real human being

## User/Groups/Policies
* Always place users in groups.
* Apply policies to groups.

## Password Policies
* Have a strong password rotation policy

## Access Keys
* Use access keys for programmatic access

## Roles
* Use roles to access other AWS services.

## IAM Credential Report
* Use IAM credential reports to audit the permissions of your users/accounts.
An example of staying DRY.
Published: 2021-05-26 00:20:22

No one enjoys having to say something over and over again. Repeating yourself can definitely be exhausting and even take you out of the mood of what you were doing, if severe enough. The same can definitely be said for coding. Having working code is always awesome. Having working code that isn't very wordy...even better. 

Chances are you've probably heard the acronym DRY when referring to code. It's gonna be something that follows you down the path of being a life long student. DRY(Don't Repeat Yourself) is a principle of computer programming that promotes the reduction of repeating information. It makes sense though, consider basic variable assignment:

```
let a=1;
let b=2;
let c=3;
```
These three lines of code can be reduced to one,  avoiding having to use the 'let' key word over and over. 

```
let a=1, b=2, c=3;
```
This reads the same as the wordier example above. This could definitely be helpful in cutting down on typos that could lead to bugs that you would have to seek out. While you probably won't start out writing DRY code all the time, its still something you should practice when you get the time to. Having working code, once again, is always great and will mold you in to a good developer. DRYing up working code and having it still work as intended could aid in making you a great developer. Happy Coding!
The Catch or Specify Requirement in Java
Tags: java, beginners, tristan
Published: 2021-05-25 23:56:38

#Introduction
- This is the second post in my exception series. It will be on the Catch or Specify Requirement in Java's exception handling. No code in this tutorial, just understanding definitions.


###The catch or specify Requirement in Java
- To be able to write valid exception handling code in Java you must honor the catch or specify requirement. This means that we must deal with exceptions in 2 ways.

- 1) **try statement** : the try statement catches the exception with an appropriate exception handler.

- 2) **throws statement** : A method that specifies it can throw a exception must specify the throws clause in the method signature.

- Any exception handling code in Java that fails to honor the catch or specify requirement when dealing with checked exceptions will not compile. If an exception is an unchecked exception, then it is not required to implement the catch or specify requirement. Checked and unchecked exceptions are better explained below.


###3 types of exceptions in Java

- 1) **Checked exceptions** : these are exceptions that your application should be able to recover from. Examples would be a file not existing or a bad input from an user. Check exceptions are subject to the catch or specify requirement. All exceptions are checked exceptions, not including  Error and RuntimeException, along with their subclasses. Both Error and RuntimeException are considered to be unchecked exceptions.

- 2) **Errors** : errors are a type of unchecked exception that happens externally to our application. These kinds of exceptions are ones our application usually can not recover from. Think hardware or system malfunction. Since errors are considered to be an unchecked exception, they do not follow the catch or specify requirement.

- 3) **Runtime Exceptions** : these are exceptions that happen internally to our application. Things like programming bugs or a logic error made in the code. The most logical way to avoid this kind of exception is to make sure your code is properly tested. Runtime exceptions are also unchecked exceptions so they do not follow the catch or specify requirement. 



#Conclusion
- Thank you for taking the time out of you day to read this blog post of mine. If you have any questions or concerns please comment below or reach out to me on [Twitter](https://twitter.com/TristAndroidDev).
- Also make sure to checkout my [YouTube](https://www.youtube.com/channel/UCN9jWE9COJ0wN1m4huDFqzw/playlists) channel for more programming tutorials