5 Responsive Layouts (KP)

/* https://codepen.io/kevinpowell/full/vYvEdWG */


.cluster {
  outline: 5px solid hotpink;
  padding: 1rem;

  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.flexible-grid {
  outline: 5px solid hotpink;
  padding: 1rem;

  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.flexible-grid > * {
  flex: 1;
}

.auto-grid {
  outline: 5px solid hotpink;
  padding: 1rem;

  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
}

.reel {
  outline

Shopify Partners Slack

rechargepartners.slack.com
shopifypartners.slack.com

Save and Uninstall Python Requirements

Save the current Python environment's requirements and uninstall them
pip freeze > requirements.txt && pip uninstall -r requirements.txt -y

Custom columns admin list users

<?php
/*
 * Plugin name: Sevanova User
 * Description: See title
 * Author: Sevanova
 * Author URI: https://www.sevanova.com
 * Version: 1.0.0
 * Text Domain: sn-user
 */

class Sevanova_User {
	// Construct
	public function __construct() {
		add_action( 'manage_users_extra_tablenav', array( $this, 'sn_manage_filter_by' ), 20, 1 );
		add_action( 'pre_get_users', array( $this, 'sn_filter_query_by' ) );
		add_filter( 'manage_users_custom_column', array( $this, 'sn_content_custom_col

Useful functions

# countVowels(string):int
# countConsonants(string):int
# countCharacters(string word, string char):int
# isAnagram(string, string):boolean
# isPalindrome(string):boolean
# pyramid(int)

def countVowels(s):
    vowels = ['a', 'e', 'i', 'o', 'u']
    count = 0
    for char in s:
        if char in vowels:
            count += 1
    return count

def countConsonants(s):
    vowels = ['a', 'e', 'i', 'o', 'u']
    count = 0
    for char in s:
        if char not in vowels:
      

Angel

U/oDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAA8PDwAAAqoAAD4AvgC+AIAAAAAAAALARwaPDw8AAD6rAAA9Vj4AvqsBxz44gAADAEAHjw8PAAABVQAAPqs+AL2rQcc+OIAAAwBAB48PDwFVP1WAAD1WPgC+qz44gccAAAMARwaPDw8AAACqgAA9Vj4AvatBxwHHAAADAEcGgAAAAAAAAD9VgAAAAAAAAAAAAAAAAwBAAA8PB4AAAAAAAD4AvgC9VgAAAAAAAARAQAqPDweAAAAAAAA+AL4AvVYAAAAAAAAEgEmBhQeCgAAAAAAAP1W/AH1WAAAAAAAABIBAB48PB4AAAAAAAD4AvgC9VgAAAAAAAARAQAqAAAANUgAAAAA/VbpW/6r+OIAAAAADAEAAAAAAMq4AAAAAAP/6VwBVPjiAAAAAAwBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM

Promises

// https://medium.com/@hxu0407/master-these-8-promise-concurrency-control-techniques-to-significantly-improve-performance-5a1c199b6b3c


// 1. Promise.all: Execute in Parallel and Return Results Together
const promise1 = Promise.resolve(1);
const promise2 = Promise.resolve(2);
const promise3 = Promise.resolve(3);
Promise.all([promise1, promise2, promise3])
  .then(results => {
    console.log(results); // Output: [1, 2, 3]
  });
  
  
  
  
// 2. Promise.allSettled: Execute in Parallel and Retur

2033. Minimum Operations to Make a Uni-Value Grid

You are given a 2D integer grid of size m x n and an integer x. In one operation, you can add x to or subtract x from any element in the grid. A uni-value grid is a grid where all the elements of it are equal. Return the minimum number of operations to make the grid uni-value. If it is not possible, return -1.
/**
 * This function calculates the minimum number of operations needed 
 * to transform a 2D grid into a uniform grid based on a given step size.
 * If it's not possible, it returns -1.
 * 
 * @param {number[][]} grid - The input 2D grid of numbers.
 * @param {number} x - The step size for allowed operations.
 * @return {number} The minimum number of operations, or -1 if not possible.
 */
var minOperations = function(grid, x) {
    // Flatten the 2D array into a 1D array and sort it in ascendin

URL redirection via Nginx


Redirect domainA.com  to domainB.com

# HTTP → HTTPS + Redirect to domainB.com
server {
    listen 80;
    server_name domainA.com www.domainA.com;
    return 301 https://domainB.com$request_uri;  # Force HTTPS first (optional)
}

# HTTPS → domainB.com
server {
    listen 443 ssl;
    server_name domainA.com www.domainA.com;

    # SSL certificates (replace paths)
    ssl_certificate /etc/letsencrypt/live/domainA.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/domainA.com/privk

B2 Unit 10

https://www.youtube.com/watch?v=3-icphihD6Y
  chase the cheapest needle
  stems from
  fast fashion
  
  outsourceced
  social media, invisible pressure
  cause and effect
  guinea pig
  received accent
  highly regulated

iam-iac-generator

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "cloudformation:StartResourceScan",
                "cloudformation:GetResourceScan",
                "cloudformation:ListResourceScans",
                "cloudformation:CreateGeneratedTemplate",
                "cloudformation:GetGeneratedTemplate",
                "cloudformation:ListGeneratedTemplates",
                "cloudformation:UpdateGeneratedTemplate",
   

9 Smart Ways to Replace if-else in JavaScript

// https://medium.com/@hxu0407/9-smart-ways-to-replace-if-else-in-javascript-28f82ad6dcb9

// 1. Object Mapping Instead of if-else
function getPrice(user) {
  if (user.type === 'vip') {
    return 'VIP Price';
  } else if (user.type === 'svip') {
    return 'SVIP Price';
  } else if (user.type === 'vvip') {
    return 'VVIP Price';
  } else {
    return 'Regular Price';
  }
}

// better
const priceStrategy = {
  vip: () => 'VIP Price',
  svip: () => 'SVIP Price',
  vvip: () => 'VVIP Price',
  de

ways.js

// https://medium.com/@hxu0407/9-smart-ways-to-replace-if-else-in-javascript-28f82ad6dcb9

Serverless Function Hosting on Vercel

### Install Vercel
- `npm install vercel`
  - Ensure you have vercel connected to a git account
- `vercel login`
- Create a directory: 
```
mkdir vercel-api
cd vercel-api
npm init -y
npm install dotenv
```
- Create `vercel-api/api/function_name.js` - this is where the serverless function will live
- Ensure the following structure:
```
/my-vercel-api
|--- api
|    |--- name_of_function.js
|--- package.json
|--- .env
|--- vercel.json
```
- Sample of handler function code:
```js
import 'dotenv/conf

JS - Swipe Mouse Desktop for SlideshowComponent

class SlideshowComponent extends SliderComponent {
  constructor() {
    super();
    
    if (this.dataset.swipe === 'true') {
      this.swipeStartX = null;
      this.swipeStartY = null;
      this.swipeThreshold = 30;
      this.addEventListener('mousedown', this.handleSwipeStart.bind(this));
      this.addEventListener('mouseup', this.handleSwipeEnd.bind(this));
      this.addEventListener('mousemove', this.handleSwipeMove.bind(this));
    }
  }

  handleSwipeStart(event) {