teleren/devto huggingface dataset:
How to disable process timeout for Composer scripts
Tags: howto, webdev, composer, bash
Published: 2022-06-07 07:23:35

If you have `composer.json` file in your project, then you might have some custom script in the `scripts` section that you want to execute via `composer {script-name}` command. 
For example, in your Laravel project you have `phpunit` and want to create a custom script for coverage test and your composer scripts section might look like this:

```
"scripts": {
...
    "coverage-test": [
        "./vendor/bin/phpunit --coverage-html tests/Reports"
    ]
}
```

When executing this command:

```
composer coverage-test
```

there is a possibility (depending on your test cases you have) that you might get the following error:

```
[Symfony\Component\Process\Exception\ProcessTimedOutException]                                 
The process "coverage-test --coverage-html tests/Reports" exceeded the timeout of 300 seconds.
``` 

You can fix it by updating your script to like this:

```
"scripts": {
...
    "coverage-test": [
        "Composer\\Config::disableProcessTimeout",
        "./vendor/bin/phpunit --coverage-html tests/Reports"
    ]
}
```

If your try the command `composer coverage-test` now, it should work without any errors.



**References:**
* https://getcomposer.org/doc/06-config.md#process-timeout
Pigeonhole Sort
Tags: javascript, programming, algorithms
Published: 2022-06-07 07:01:19

What do we understand about Pigeonhole Sort?
 - Very very very simple and straightforward sorting algorithm
 - One of the most effecient sorting algorithm with JS implementation to be as fast as 1 digit millisecond
 - Is **NOT** a comparison sort
 - **ONLY** Interger values from negative to positive
 - **Stable algorithm**
 - Handles sorting by placing integer value by index of new Array
 - The new Array's index holds an Array of the copied integer value when interated over
 - In JS can be done in **ONE** loop
 - Returns a new Array
 - Time complexity 
    - Best      is O(n+k)
    - Average   is O(n+k)
    - Worst     is O(n+k)
 - Space complexity
    - O(n+k)
 - Note: n – Size of array, k - Range of value

```js
function PigeonHoleSort(arr) {
  const min = Math.min(...arr);
  const pigeonhole = [];

  arr.forEach(num => {
    if (pigeonhole[num - min]) pigeonhole[num - min].push(num);
    else pigeonhole[num - min] = [num];
  });
  return pigeonhole.flat();
}
```
Increasing Triplet Subsequence
Tags: leetcode, dsa, theabbie
Published: 2022-06-07 07:00:50

Given an integer array `nums`, return `true` _if there exists a triple of indices_ `(i, j, k)` _such that_ `i < j < k` _and_ `nums[i] < nums[j] < nums[k]`. If no such indices exists, return `false`.

**Example 1:**

**Input:** nums = \[1,2,3,4,5\]
**Output:** true
**Explanation:** Any triplet where i < j < k is valid.

**Example 2:**

**Input:** nums = \[5,4,3,2,1\]
**Output:** false
**Explanation:** No triplet exists.

**Example 3:**

**Input:** nums = \[2,1,5,0,4,6\]
**Output:** true
**Explanation:** The triplet (3, 4, 5) is valid because nums\[3\] == 0 < nums\[4\] == 4 < nums\[5\] == 6.

**Constraints:**

*   `1 <= nums.length <= 5 * 105`
*   `-231 <= nums[i] <= 231 - 1`

**Follow up:** Could you implement a solution that runs in `O(n)` time complexity and `O(1)` space complexity?**SOLUTION:**

    class Solution:
        def increasingTriplet(self, nums: List[int]) -> bool:
            n = len(nums)
            minval, maxval = min(nums), max(nums)
            for i in range(1, n - 1):
                if nums[i] > minval and nums[i] < maxval:
                    if min(nums[:i]) < nums[i] and nums[i] < max(nums[i+1:]):
                        return True
            return False
How do I know the PMP?
Tags: management
Published: 2022-06-07 06:53:22

The research suggests that employers will require more than 2.2 million new positions based on projects every year until 2027. That means experienced PMs are always in great demand. The PMP certification is created by project professionals, specifically for professionals in the field of project management. It proves that you're an expert in:

people:emphasizing the soft skills you require to manage a team of project workers in today's ever-changing context.

Procedure:reinforcing the technical aspects of effectively managing projects.

Business Environmenthighlighting how projects are linked to strategies for the organization.

PMP certification certifies that you possess the leadership qualities employers are looking for. The latest PMP is comprised of three fundamental strategies:

Predictive (waterfall)
Agile
Hybrid

Gain a competitive edge. Prove you work smarter. Let your dreams become a reality. Get your PMP today.

Apply to get [PMP Certification](https://www.edureka.co/aws-certification-training)
Create or Login to Your Account
Continue
Get ready to take the Exam PMP (r) Exam
PMI (r) Authorized PMP on-demand (r) Exam Prep
Instruction by an instructor
PMP (r) Practice Exam
Covid Update

PMI has a strong commitment to security and well-being of our worldwide community. As a result of COVID-19, there have been major modifications to certification tests that could affect your. Check out the COVID-19 pages with the most current information and guidelines.

**What is the reason for the PMP**

The PMP can add value. CIO magazine has ranked PMP as the PMP as the best PMP certification within North America because it demonstrates you have the particular qualities employers look for, dedication to excellence, and the ability to achieve at the highest level.

The PMP provides advantages. Median salary for PMP experts within North America is 25% more than the average salary in Europe.
for those who don't have it.

The PMP shows you work more efficiently. It demonstrates that you have the abilities to boost business results and enhance your company's influence at work and across the world.
Tailwind CSS 3D Button Example
Tags: tailwindcss, css, webdev, tutorial
Published: 2022-06-07 06:44:38

In this section we will create tailwind 3D button, tailwind 3d button effect, 3d button with skew, 3d button animation tailwind example with Tailwind CSS 3. 
[view](https://larainfo.com/blogs/tailwind-css-3d-button-example)

### Example 1
Tailwind simple 3 button with hover effect.
```html
<button
    class="px-6 py-2 font-semibold text-white bg-blue-500 border-b-4 border-blue-800 rounded hover:border-blue-600">Button</button>
<button
    class="px-6 py-2 font-semibold text-white bg-green-500 border-b-4 border-green-800 rounded hover:border-green-600">Button</button>
<button
    class="px-6 py-2 font-semibold text-white bg-purple-500 border-b-4 border-purple-800 rounded hover:border-purple-600">Button</button>
<button
    class="px-6 py-2 font-semibold text-white border-b-4 rounded bg-cyan-500 border-cyan-800 hover:border-cyan-600">Button</button>
```

![tailwind css 3d button](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/506j8urxyudv5gqwbjym.png)

tailwind 3d button with different positions.
```html
<button
    class="px-6 py-2 font-semibold text-white bg-blue-500 border-t-4 border-blue-800 rounded shadow-lg shadow-blue-500/50 hover:border-blue-600">Button</button>
<button
    class="px-6 py-2 font-semibold text-white bg-green-500 border-l-4 border-green-800 rounded shadow-lg shadow-green-600/50 hover:border-green-600">Button</button>
<button
    class="px-6 py-2 font-semibold text-white bg-purple-500 border-r-4 border-purple-800 rounded shadow-lg shadow-purple-600/50 hover:border-purple-600">Button</button>
<button
    class="px-6 py-2 font-semibold text-white border-b-4 rounded shadow-lg bg-cyan-500 border-cyan-800 shadow-cyan-600/50 hover:border-cyan-600">Button</button>
```

![tailwind 3d button with shadow style](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/25b2gpk1qv37o5eygph2.png)

### Example 2
Tailwind CSS 3d button with 3d skew effect.
```html
<button
    class="px-6 py-2 font-sans font-semibold text-white transition duration-300 ease-in-out delay-300 skew-y-6 bg-purple-600 border-b-4 border-purple-800 rounded shadow-lg shadow-purple-600/50 hover:skew-x-6 hover:border-purple-600">Button</button>
<button
    class="px-6 py-2 font-sans font-semibold text-white transition duration-300 ease-in-out delay-300 skew-y-6 border-b-4 rounded shadow-lg bg-cyan-600 border-cyan-800 shadow-cyan-600/50 hover:skew-x-6 hover:border-cyan-600">Button</button>
<button
    class="px-6 py-2 font-sans font-semibold text-white transition duration-300 ease-in-out delay-300 skew-y-6 bg-red-600 border-b-4 border-red-800 rounded shadow-lg shadow-red-600/50 hover:skew-x-6 hover:border-red-600">Button</button>
```

![tailwind 3d skew button](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h7gj4xze91cpdef3yi2p.png)
tailwind 3d button animation.

```html
<button
    class="px-6 py-2 font-sans font-semibold text-white transition duration-300 ease-in-out delay-300 skew-y-6 bg-purple-600 border-b-4 border-purple-800 rounded shadow-lg shadow-purple-600/50 hover:transform-none hover:border-purple-600">Button</button>
```
Longest Palindrome
Tags: leetcode, dsa, theabbie
Published: 2022-06-07 06:30:42

Given a string `s` which consists of lowercase or uppercase letters, return _the length of the **longest palindrome**_ that can be built with those letters.

Letters are **case sensitive**, for example, `"Aa"` is not considered a palindrome here.

**Example 1:**

**Input:** s = "abccccdd"
**Output:** 7
**Explanation:**
One longest palindrome that can be built is "dccaccd", whose length is 7.

**Example 2:**

**Input:** s = "a"
**Output:** 1

**Example 3:**

**Input:** s = "bb"
**Output:** 2

**Constraints:**

*   `1 <= s.length <= 2000`
*   `s` consists of lowercase **and/or** uppercase English letters only.

**SOLUTION:**

    from collections import Counter
    
    class Solution:
        def longestPalindrome(self, s: str) -> int:
            ctr = Counter(s)
            maxOdd = 0
            evens = 0
            for c in ctr:
                if ctr[c] % 2 == 0:
                    evens += ctr[c]
                else:
                    evens += ctr[c] - 1
                    maxOdd = max(maxOdd, 1)
            return maxOdd + evens
A Quick Guide to Migrate from Universal Analytics to Google Analytics 4
Tags: digitalmarketing, seostrategy
Published: 2022-06-07 06:23:31


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q5tfav0pa14x4u14ipce.jpg)
GA4 is a reliable and easy-to-use system for migration from UA to GA4. The migration process is quick and painless, So you can get started with GA4 right away. The new upgrade, Google Analytics 4 ( GA4 ) has surprised many as Google is using a new naming convention.  Though Universal Analytics had major updates in the past like Global Site Tags and Google Tag manager, the release of GA4 is considered to be the biggest move by the search engine giant.  This change is much needed, with exponential growth in mobile applications in the last 8 years.  Google realized the need to unify the experience between Website + Application to provide accurate data for Google Analytics users.  Also, the recent privacy policies over cookies on user tracking, needed the new analytics tool to be compliant.

**Let’s explore in this blog…**

Migrating from UA to GA4 using GTM
What will happen to your already existing UA?
Key Differences between UA & GA4
Cool Features of GA4

**Click to Learn More:** [A Quick Guide to Migrate from Universal Analytics to Google Analytics 4](https://www.pixel-studios.com/blog/a-quick-guide-to-migrate-from-universal-analytics-to-google-analytics-4-ga4/)
Sha Web Design Singapore
Published: 2022-06-07 06:17:04

Sha [Web Design Singapore](https://www.shawebdesignsingapore.com/) is a professional web design company in Singapore that helps businesses expand with web solutions. From designing your website to conducting Search Engine Optimization (SEO) and social media marketing, we strive to increase your brand value. We understand your needs and wants when it comes to having a strong online presence.
Razorpay payment DJANGO (prod)
Tags: payment
Published: 2022-06-07 06:15:26

# Steps to integrate Razorpay 

* Checking update blog.

* Storing API keys in settings.py

* Installing Razorpay library.

* Creating order using Razorpay API.

* Sorry, unable to save it. You might have moved your notion database to some other page, please take it back to the page where it was created.

* Creating order at backend and also creating Razorpay order.

	* Show template

	* Show views

	* render to payment.html

	* Get info of call back URL

	* Done with creating an order.

* Making payment.

* Handling payment success and failure.

	* Razorpay makes a post request

	* with the help of that handling success/failure

	* Done with payment.

	* Final checks for all platforms

	* Final checking

	* what is this project about?

![](https://notionpack-uploads.s3.amazonaws.com/blog_images/tmp/tmpewtsf9k9.png)
จด swap ram
Published: 2022-06-07 06:04:40

https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-20-04?fbclid=IwAR1dshh04rLAtbmXlX-wuhigYSXvzY_o_vDEszNHtoODbkXmeKHm1I9R4bc
Reduce Array Size to The Half
Tags: leetcode, dsa, theabbie
Published: 2022-06-07 06:00:45

You are given an integer array `arr`. You can choose a set of integers and remove all the occurrences of these integers in the array.

Return _the minimum size of the set so that **at least** half of the integers of the array are removed_.

**Example 1:**

**Input:** arr = \[3,3,3,3,5,5,5,2,2,7\]
**Output:** 2
**Explanation:** Choosing {3,7} will make the new array \[5,5,5,2,2\] which has size 5 (i.e equal to half of the size of the old array).
Possible sets of size 2 are {3,5},{3,2},{5,2}.
Choosing set {2,7} is not possible as it will make the new array \[3,3,3,3,5,5,5\] which has a size greater than half of the size of the old array.

**Example 2:**

**Input:** arr = \[7,7,7,7,7,7\]
**Output:** 1
**Explanation:** The only possible set you can choose is {7}. This will make the new array empty.

**Constraints:**

*   `2 <= arr.length <= 105`
*   `arr.length` is even.
*   `1 <= arr[i] <= 105`

**SOLUTION:**

    import heapq
    
    class Solution:
        def minSetSize(self, arr: List[int]) -> int:
            n = len(arr)
            ctr = {}
            for num in arr:
                ctr[num] = ctr.get(num, 0) + 1
            heap = [(-v, k) for k, v in ctr.items()]
            heapq.heapify(heap)
            i = 0
            size = 0
            while size < n / 2:
                v, k = heapq.heappop(heap)
                size -= v
                i += 1
            return i
How to use Recoil Selectors in Nextjs
Tags: nextjs, recoil, state, management
Published: 2022-06-07 05:40:49

Welcome 👋, to this new blog post where I will teach you how you can use selectors in recoil for state management.

### 🤔Difference between Atoms and Selectors

Atoms are used to store a value. But selectors are used to getting or setting the value of an atom. In simple words, selectors help you perform complex logic for your website.

### 😁Situation

Let’s suppose I give you a project of making a currency converter. In this project, you need to have two inputs US dollars and Rupee. But the problem is how will you convert the US dollars to Rupee in recoil so that you can use values globally.

### 💡Solution

We can use selectors here. But how?

Step1: Setup your recoil.
[**Recoil State Management in Nextjs**](https://nextdev1111.hashnode.dev/recoil-state-management-in-nextjs)

Step2: Now make a new atom called usdAtom 
{% gist https://gist.github.com/studywithdesign/8e0eaeb6fa3081e4766919dd9f361d4a.js %}
Then come to your index.tsx file

Step3: Now make a new selector called rupeeSelector 
{% gist https://gist.github.com/studywithdesign/a0316cd9e6b9cddb48375b0c1e23485e.js %}
Now you can enjoy the values 
{% gist https://gist.github.com/studywithdesign/19a0fb2bc5bcd757612cc71e075e0099.js %}
Whole Code:
[**GitHub - nextdev1111/selectors**](https://github.com/nextdev1111/selectors)
Namespace as a Service with vanilla kubernetes objects
Tags: kubernetes, beginners, tips
Published: 2022-06-07 05:39:30

With plain kubernetes objects a simple multi-tenancy model can be achieved using the following kubernetes objects:
1. [namespace](https://github.com/ashok-an/rbac-helm/blob/main/rationed-namespace/templates/namespace.yaml)
This creates a namespace object with additional annotations (to be used later for additional capabilities)

2. [resourcequota](https://github.com/ashok-an/rbac-helm/blob/main/rationed-namespace/templates/resourcequota.yaml) to apply quotas in-terms of:
- cpu
- memory
- total storage volume
- pv counts
- pvc counts
- pod counts
- secret counts
- service counts (clusterIP, nodePort and loadBalancer)

3. [limitrange](https://github.com/ashok-an/rbac-helm/blob/main/rationed-namespace/templates/limitrange.yaml) default min and max for cpu, memory and pvc sizes

_optionally_
4. [networkpolicy](https://github.com/ashok-an/rbac-helm/blob/main/rationed-namespace/templates/_networkpolicy.yaml) to restrict ingress and egress traffic

5. [serviceaccount](https://github.com/ashok-an/rbac-helm/blob/main/rationed-namespace/templates/serviceaccount.yaml) for generic account for machine users and automation use-cases

6. [rbac](https://github.com/ashok-an/rbac-helm/blob/main/rationed-namespace/templates/rolebinding.yaml) for authorization use cases

Repo link with a helm chart to do the above is [here](https://github.com/ashok-an/rbac-helm)
Triangle
Tags: leetcode, dsa, theabbie
Published: 2022-06-07 05:30:39

Given a `triangle` array, return _the minimum path sum from top to bottom_.

For each step, you may move to an adjacent number of the row below. More formally, if you are on index `i` on the current row, you may move to either index `i` or index `i + 1` on the next row.

**Example 1:**

**Input:** triangle = \[\[2\],\[3,4\],\[6,5,7\],\[4,1,8,3\]\]
**Output:** 11
**Explanation:** The triangle looks like:
   2
  3 4
 6 5 7
4 1 8 3
The minimum path sum from top to bottom is 2 + 3 + 5 + 1 = 11 (underlined above).

**Example 2:**

**Input:** triangle = \[\[-10\]\]
**Output:** -10

**Constraints:**

*   `1 <= triangle.length <= 200`
*   `triangle[0].length == 1`
*   `triangle[i].length == triangle[i - 1].length + 1`
*   `-104 <= triangle[i][j] <= 104`

**Follow up:** Could you do this using only `O(n)` extra space, where `n` is the total number of rows in the triangle?**SOLUTION:**

    class Solution:
        def minPath(self, triangle, i, j, n):
            if i == n - 1:
                return triangle[i][j]
            if (i, j) in self.cache:
                return self.cache[(i, j)]
            currmin = min(self.minPath(triangle, i + 1, j, n), self.minPath(triangle, i + 1, j + 1, n))
            self.cache[(i, j)] = triangle[i][j] + currmin
            return self.cache[(i, j)]
        
        def minimumTotal(self, triangle: List[List[int]]) -> int:
            self.cache = {}
            return self.minPath(triangle, 0, 0, len(triangle))
Find First and Last Position of Element in Sorted Array
Tags: leetcode, dsa, theabbie
Published: 2022-06-07 05:00:46

Given an array of integers `nums` sorted in non-decreasing order, find the starting and ending position of a given `target` value.

If `target` is not found in the array, return `[-1, -1]`.

You must write an algorithm with `O(log n)` runtime complexity.

**Example 1:**

**Input:** nums = \[5,7,7,8,8,10\], target = 8
**Output:** \[3,4\]

**Example 2:**

**Input:** nums = \[5,7,7,8,8,10\], target = 6
**Output:** \[-1,-1\]

**Example 3:**

**Input:** nums = \[\], target = 0
**Output:** \[-1,-1\]

**Constraints:**

*   `0 <= nums.length <= 105`
*   `-109 <= nums[i] <= 109`
*   `nums` is a non-decreasing array.
*   `-109 <= target <= 109`

**SOLUTION:**

    class Solution:
        def search(self, nums, target, cmp, ncmp):
            beg = 0
            end = len(nums)
            while beg <= end:
                mid = (beg + end) // 2
                if mid >= len(nums):
                    break
                curr = nums[mid]
                prev = nums[mid - 1] if mid > 0 else curr - 1
                forw = nums[mid + 1] if mid < len(nums) - 1 else curr + 1
                if curr == target and cmp(prev, forw):
                    return mid
                elif beg == end:
                    break
                elif ncmp(curr):
                    beg = mid + 1
                else:
                    end = mid
            return -1
        
        def searchRange(self, nums: List[int], target: int) -> List[int]:
            return [
                self.search(nums, target, lambda p, f: p < target, lambda c: c < target),
                self.search(nums, target, lambda p, f: f > target, lambda c: c <= target)
            ]
Sum of Root To Leaf Binary Numbers
Tags: leetcode, dsa, theabbie
Published: 2022-06-07 04:30:48

You are given the `root` of a binary tree where each node has a value `0` or `1`. Each root-to-leaf path represents a binary number starting with the most significant bit.

*   For example, if the path is `0 -> 1 -> 1 -> 0 -> 1`, then this could represent `01101` in binary, which is `13`.

For all leaves in the tree, consider the numbers represented by the path from the root to that leaf. Return _the sum of these numbers_.

The test cases are generated so that the answer fits in a **32-bits** integer.

**Example 1:**

![](https://assets.leetcode.com/uploads/2019/04/04/sum-of-root-to-leaf-binary-numbers.png)

**Input:** root = \[1,0,1,0,1,0,1\]
**Output:** 22
**Explanation:** (100) + (101) + (110) + (111) = 4 + 5 + 6 + 7 = 22

**Example 2:**

**Input:** root = \[0\]
**Output:** 0

**Constraints:**

*   The number of nodes in the tree is in the range `[1, 1000]`.
*   `Node.val` is `0` or `1`.

**SOLUTION:**

    # Definition for a binary tree node.
    # class TreeNode:
    #     def __init__(self, val=0, left=None, right=None):
    #         self.val = val
    #         self.left = left
    #         self.right = right
    class Solution:
        def sumRootToLeaf(self, root: Optional[TreeNode]) -> int:
            total = 0
            paths = [(root, root.val if root else 0)]
            i = 0
            while i < len(paths):
                curr, currval = paths[i]
                if curr.left or curr.right:
                    if curr.left:
                        paths.append((curr.left, 2 * currval + curr.left.val))
                    if curr.right:
                        paths.append((curr.right, 2 * currval + curr.right.val))
                else:
                    total += currval
                i += 1
            return total
A compelling argument as to why we should use eþ and þorn.
Tags: eth, thorn, english, watercooler
Published: 2022-06-07 04:22:42

Ðis is what my English teacher described as "Ðe beginning to a Masters level þesis."; [Why We Should Bring Back Þorn and Eþ](https://docs.google.com/presentation/d/e/2PACX-1vT_ncK4sKUf6wdxDBDSsHucPwEs2WE8mELnCuS7oTzX6cFsl9w0We1cNZb_TebaNbyyZmZsA13ALiFd/pub?start=false&loop=false&delayms=60000).
A sixteen page article on why I þink þorn and eþ deserve to come back into English.
What's the best way to make a CSS animation?
Published: 2022-06-07 04:08:37

I have a question how can we make a CSS animation like we see on the television screen a lot of animated objects.Can somebody explain this to me in detail. My question is how can we produce a good looking CSS animations for our projects without wasting too much time.
[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/28ubcm2oj80njundaj37.JPG)](https://futbolred.net/)