teleren/devto huggingface dataset:
Adding Featured Images to your Wordpress admin columns
Tags: wordpress
Published: 2023-02-07 11:32:53

A little Wordpress snippet to show the thumbnails in the Wordpress Admin columns. I feel like Wordpress probably could really allow us an interface to customise the heck out of the admin columns as they don't always show the data you want for more complex sites. 
We are using this on [UCG](https://ucg.com.au/dark-fibre/) and [Sales Tax USA](https://salestaxusa.com/woocommerce-tax-rates-csv/) to track which posts have good CTR on their featured images.  

 Just add it to your Functions.php and it will appear in your admin. 

```
add_filter('manage_posts_columns', 'posts_columns', 1);
add_action('manage_posts_custom_column', 'posts_custom_columns', 1, 2);
function posts_columns($defaults){
    $defaults['seanaus120_post_thumbs'] = __('Thumbs');
    return $defaults;
}
function posts_custom_columns($column_name, $id){
    if($column_name === 'seanaus120_post_thumbs'){
        echo the_post_thumbnail( 'thumbnail' );
    }
}
```

Currently in use at:
[NYC Posters](https://www.printingnewyork.com/poster-printing-nyc/)
[Gorilla Printing](https://gorillaprinting.com/wheatpasting/)
[Gorilla Printing](https://gorillaprinting.com/wheatpaste-posters/)
[Wine N Liquor](https://winenliquor.com/types-of-champagne/)
[Wheatpaste Posters](https://wheatpasteposters.com/)
[Wild Posters](https://wildposters.com/posting/)
[UCG](https://ucg.com.au/dark-fibre/)
[ReWorder](https://reworder.com.au)
[PLA](https://printinglosangeles.com/)
[SignsCity](https://signscity.com/)
[WildPosters](https://wildposters.com/wild-posting/los-angeles/)
[SalesTaxUSA](https://salestaxusa.com/woocommerce-tax-rates-csv/)
[WineVybe](https://winevybe.com/beer-api/)
[Sales Tax API](https://salestaxusa.com/sales-tax-api/)
Customer Relationship Management
Published: 2023-02-07 11:27:30

Ready to take your [Customer Relationship Management System](https://www.genicsolutions.com/customer-relationship-management/) to the next level? 🚀 With Genic Solutions’ software, you can easily strengthen your relationships with existing customers while attracting prospective customers without any hurdles. Try it today and see the difference!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gb2ywjpw4rdbawgs5noc.png)
#CRM #CustomerRelationshipManagement #Software
Display the 'next 5' posts in a shortcode with Wordpress
Published: 2023-02-07 11:27:25

I like how magazines often show a little section with the next few (or related) posts halfway down the article and wanted to build this for myself to add to some Wordpress sites like [Sales Tax USA](https://salestaxusa.com/woocommerce-tax-rates-csv/). 

Here's a little snippet you can add to Functions.php to achieve it. Just use [next_five_posts] as a shortcode where you want it to appear: 

```
function next_five_posts_shortcode() {
    global $post;
    $current_post = $post->ID;
    $args = array(
        'posts_per_page' => 5,
        'post__not_in' => array($current_post),
        'offset' => 1
    );
    $next_five_posts = new WP_Query($args);
    if($next_five_posts->have_posts()) {
        $output = '<ul class="extraposts">';
        while($next_five_posts->have_posts()) {
            $next_five_posts->the_post();
            $output .= '<li><a href="'.get_the_permalink().'">'.get_the_title().'</a></li>';
        }
        $output .= '</ul><';
    } else {
       
    }
    wp_reset_postdata();
    return $output;
}
add_shortcode('next_five_posts', 'next_five_posts_shortcode');

```

Currently in use at:
[Wild Posting](https://wildposters.com/wild-posting/)
[Gorilla Printing](https://gorillaprinting.com/wild-posting/)
[Wine N Liquor](https://winenliquor.com/alcohol-delivery-los-angeles/)
[UCG](https://ucg.com.au/dark-fibre/)
[ReWorder](https://reworder.com.au)
[PLA](https://printinglosangeles.com/)
[SignsCity](https://signscity.com/)
[PluginRush](https://pluginrush.com/)
[SalesTaxUSA](https://salestaxusa.com/woocommerce-tax-rates-csv/)
[WineVybe](https://winevybe.com/beer-api/)
[Sales Tax API](https://salestaxusa.com/sales-tax-api/)
Image Pixelation using Lambda and S3 Events
Tags: aws, cloud, awscommunity, 100daysofcloud
Published: 2023-02-07 11:09:24

[38/100] #100DaysOfCloud Today, I created a simple event-driven image processing pipeline where the source image is pixelated into 5 different variations.

A simple event-driven image processing pipeline is created. The pipeline uses two S3 buckets, a source bucket and a destination bucket. When images are added to the source bucket a lambda function is triggered based on the PUT. When invoked the lambda function receives the event and extracts the bucket and object information. Once those details are known, the lambda function, using the PIL module pixelates the image with 5 different variations (8x8, 16x16, 32x32, 48x48 and 64x64) and uploads them to the processed bucket.

You can try do it by yourself by following the steps from the link below: [GitHub](https://github.com/aaditunni/100DaysOfCloud/blob/main/Journey/038/Readme.md)
Deno vs NodeJs
Tags: javascript, webdev, programming, beginners
Published: 2023-02-07 11:00:47

Deno is a new way to write server-side JavaScript it solves many of the problems of nodejs and was even created by the same guy (Ryan Dahl).
like node it uses the v8 JavaScript engine under the hood but the rest of the runtime is implemented in rust and typescript.

Deno and Node.js are both JavaScript runtime environments, but they have some key differences:

### Modules: 
Node.js uses a centralized package manager (npm), while Deno uses modules directly from URL imports.

### Security: 
Deno operates with a security-first mindset and runs scripts in a sandbox environment by default, while in Node.js, scripts have access to the file system and network by default.

### TypeScript: 
Node.js supports TypeScript, but it must be transpiled to JavaScript, while Deno includes TypeScript support out of the box.

### Standard Library: 
Node.js has a large standard library, while Deno provides a comprehensive standard library for its runtime environment, which includes modules for HTTP, WebSockets, and more.

### Package Management: 
Node.js relies on npm for package management, which can result in versioning issues, while Deno operates without a centralized package manager and relies on importing modules directly from URLs.

### Background Threads: 
Node.js uses a separate thread pool for background operations, while Deno runs all code in a single thread.



Here is an example of how to create a simple HTTP endpoint using both Deno and Node.js:

Deno
```ts
import { serve } from "https://deno.land/std/http/server.ts";
const server = serve({ port: 8000 });
console.log("Listening on http://localhost:8000/");
for await (const req of server) {
  req.respond({ body: "Hello World\n" });
}

```

Node.js
```ts
const http = require('http');
const server = http.createServer((req, res) => {
  res.end('Hello World\n');
});
server.listen(8000, () => {
  console.log('Listening on http://localhost:8000/');
});

```


Overall, Deno aims to provide a more secure, modern, and streamlined experience for JavaScript development but it is still relatively new and has limited community support as compared to Node.js.



Worths watching videos to explore more: 
 - Introduce: https://www.youtube.com/watch?v=F0G9lZ7gecE
 - Example with Prisma, Deno: https://www.youtube.com/watch?v=P8VzA_XSF8w

**Caveat**: if you are going to use Deno in a monorepo to be able to use common model with React or etc that is based on Nodejs, there is an issue, since using implicit `.ts` extension is required in Deno  https://github.com/denoland/deno/issues/2506

Let me know in the comments below thanks for reading, will create another comparison with [bun](https://bun.sh/) make sure to follow to not miss that.
HASH
Getting Started with the .NET MAUI Autocomplete Control
Tags: dotnet, csharp, dotnetmaui
Published: 2023-02-07 10:55:51

Learn how to create and configure the Syncfusion .NET MAUI Autocomplete control in a .NET MAUI project using Visual Studio 2022. In this video, you will learn how to add a simple .NET MAUI Autocomplete to a .NET MAUI app. You will see how to populate the control’s data source, set a custom height and width to the control, customize placeholder text, change the filter type, and hide clear button. 

_Product overview_: https://www.syncfusion.com/maui-controls/maui-autocomplete

_Tutorial video_: https://www.syncfusion.com/tutorial-videos

_Download example from GitHub_: https://github.com/SyncfusionExamples/getting-started-with-the-dotnet-maui-autocomplete-control

{% youtube ontSh2NZvE4 %}
Notification service via [matrix] and WebHooks
Tags: matrix, webhook
Published: 2023-02-07 10:53:56

_Questo articolo è disponibile anche in [italiano](https://dev.to/vaiton/notifiche-via-matrix-e-webhook-efo)_

Have you ever wanted to set up a notification service for your long standing process / monitoring and didn't know how to do it without setting up an [MTA](https://search.brave.com/search?q=mail+transfer+agent&source=web)? 

Don't get me wrong, emails are good, but sometimes you need a faster approach than setting up postfix (or exim4) with a smarthost and bla bla bla when you just need to be able to recieve a notification when something goes wrong!

In this guide we leverage the power of webhooks and the matrix network to do exactly that.

## 1. Create a webhook 

First, create a new Matrix room. **Be sure to make it unencrypted**, as t2bot.io webhooks bridge still doesn't support encrypted rooms.

Then, follow [t2bot.io documentation for creating a webhook](https://t2bot.io/webhooks/):
> 1. Invite `@_webhook:t2bot.io` to your Matrix room.
> 2. Send the message `!webhook`
> 3. The bridge will send you a URL to use alongside simple instructions on how to use it.

## 2. Create the script

Create a file named `notifyMatrix.py` and paste this snippet:

(I'm using python for simplicity, but you could also do a simple `curl`!)

```python
#!/bin/env python3
import requests
import sys

args = " ".join(sys.argv[1:])

WEBHOOK = "..."
BOTNAME = "..."

requests.post(WEBHOOK, 
    json={"text": args, "format": "plain", "displayName": BOTNAME})
```

- `WEBHOOK` should be set to the URL that the bot gave you previously. 
- `BOTNAME` can be set to anything. It will be used as the username that _sends_ the message to the Matrix room.

The script simply takes the last {% katex inline %}n-1{% endkatex %} arguments, creates a string by joining them (with a space in between each) and sends it to the specified webhook.

Now try running
```shell
./notifyMatrix.py ciao!
```
and you should get a message in the room you created with the content `ciao!`. 

If everything went well, you should have your notification service up and running, and it took only a couple of minutes!

## 3. Usage

You can now use the script wherever you want, for example in a system with a software RAID controlled by MDADM:

In `/etc/mdadm/mdadm.conf`
```conf
...
PROGRAM /root/notifyMatrix.py
...
```

and you're done!

## Credits
- [t2bot.io](https://t2bot.io/)
- [[matrix]](https://matrix.org/) 

If you enjoyed this guide and/or found it useful, consider donating to [t2bot.io](https://t2bot.io/donations/) and to the [matrix foundation](https://matrix.org/supporters/)!
How Learning Management Systems Reduce Training Times & Costs for Truck Drivers
Tags: learning, management, training
Published: 2023-02-07 10:50:23

Modern technology has digitalized all kinds of processes within supply chain and logistics, and employee education is no exception. Today, Learning Management Systems (LMS) are the widely accepted next step in the evolution of staff training, and a custom built LMS is, in turn, the next level within this high value learning experience.
https://innovecs.com/blog/how-learning-management-systems-reduce-training-times-costs-for-truck-drivers/
What is HTML
Tags: webdev, beginners, html, programming
Published: 2023-02-07 10:47:11

HTML stands for Hypertext Markup Language and is the standard markup language used to create web pages. It is a system for annotating a text document in a way that specifies how the document should be displayed in a web browser.

HTML consists of a series of tags that describe the structure and content of a web page. Some of the most common tags include:

<html>: Defines the beginning and end of a web page.

<head>: Contains information about the document such as its title, keywords and scripts.

<body>: Contains the main content of the web page.

<header>: Represents a container for introductory content or a set of navigational links

<nav>: Defines a section of a page that contains navigation links.

<section>: Represents a standalone section that contains related content.

<article>: Defines a self-contained composition in a document, such as a blog post or a forum post
Basic Auto Dubbing
Published: 2023-02-07 10:34:19

In this project, I developed an application that makes `automatic dubbing` dusing `python`. Although it is not a high-level application, you can successfully get the results you want if you extract the sounds and `listen` to the application.

First of all, go to [this link](https://github.com/bekiryazgann/basic-auto-dubbing) and clone the project to your computer.

> You can do it like this (you need git installed on your computer)
> ``` bash
> $ git clone https://github.com/bekiryazgann/basic-auto-dubbing
> ```
<br>
> ``` bash
> $ cd basic-auto-dubbing
> ```

### Let's set the requirements

> Let's install the ``translate`` package
> ``` bash
> $ pyton3.10 -m pip install translate
> ```

> In the ``gtts`` package
> ``` bash
> $ pyton3.10 -m pip install gtts
> ```

> In the ``SpeechRecognition`` package
> ``` bash
> $ pyton3.10 -m pip install SpeechRecognition
> ```

----

### Run the application
Now all that remains is to run our application.

> In the ``SpeechRecognition`` package
> ``` bash
> $ pyton3.10 main.py
> ```


From now on, all you have to do is set the language you want to translate from which language in the `main.py` file (you can find the language codes on the internet) and start speaking the language clearly from whichever language you chose to translate from. The application will not delete your audio files. You can then use them.
i need a help.given a task.
Published: 2023-02-07 10:23:25

I need to read the data_source_x table via Laravel v9 Controller functions and populate data for the 4 tables below.

Table 1 users
Table 2 orders — user_id, package_id(free) for each user
Table 3 properties
Table 4 property_aminities — after insert properties (ref data_source_x.facilities)

Important steps 
 


SELECT * data_source
INSERT to 4 tables

This is not a CRUD operation task so I don’t need to view or input forms for this development.


I need to find the related index data from other given tables like 
property_purposes
property_types
packages(free)
property_aminities after inserting properties data.

  MY TASK IS Find the 
properties.city_id from 'cities table' by matching with (PHP or mysql) data_source_x.address.

CAN ANY ONE GIVE ME A HELP AND INSTRUCTION
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vl038ivqsy5wfrgj5ezg.png)
Can I use Apple Pay at KFC?
Tags: apple, pay, kfc, food
Published: 2023-02-07 10:20:19

If you're looking for "Does KFC Accept Apple Pay?," keep reading to find out if the fast food chain does or not.

**Can I use Apple Pay at KFC?**

If your Searching for [Can I use Apple Pay at KFC?](https://omtechie.com/does-kfc-take-the-apple-pay) the answer is **YES **, Apple Pay is a popular mobile payment and digital wallet service provided by Apple Inc. It allows users to make purchases with their iPhone, iPad, Apple Watch, or Mac.
With Apple Pay, users can securely store their credit and debit card information and use it for making payments at participating merchants.

When it comes to fast food chains, KFC is a well-known brand and has many locations worldwide. Whether or not you can use Apple Pay at KFC depends on the specific location you visit. 
Some KFC restaurants may accept Apple Pay as a form of payment, while others may not.

It's always a good idea to check with your local KFC restaurant to confirm if they accept Apple Pay before making a purchase. 
You can also use the Apple Pay website or the Apple Wallet app to see a list of participating merchants in your area.

In conclusion, while some KFC locations may accept Apple Pay, it is best to check with your local restaurant to confirm if they support this payment method.
VSCode With Top Extensions
Tags: vscode, beginners
Published: 2023-02-07 10:17:39

Here is list you can use extension on your VS i am using they increase my productivity.

=> Better Comments.
=> Live Server.
=> Prettier - Code formatter.
=> GitLens — Git supercharged
=> Colorize 
=> Peacock
=> Turbo Console Log
=> Window Colors
=> Blackbox.
=> Auto Close Tag
=> Tabnine AI Autocomplete for Javascript, Python, Typescript, PHP, Go, Java, Ruby & more


any other do you use please suggested me i will use
How to solve a DSA problem
Tags: dsa, beginners, logicapps, topice
Published: 2023-02-07 10:05:55

Hers is Golden Word
Without go into water we can not become **swimmers**.


These are the steps that you should follow:

* Get a question (Start with simple question)
* Understand the question completely(Try Until it clear to you).
* Get an estimate of the required complexity(Ask to interview) .
* Come up with edge cases based on the constraints.
* Come up with a brute-force solution. Verify if it will pass.
* Optimize, verify and repeat this step.
* Dry-run your solution on the sample tests and edge cases.
* Code and test with the sample tests and edge cases.
* Submit. Debug and fix, if the solution does not work for yo.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y3tvl8bj2qp4i2axolhy.png)
The Only Rounding Function You Will Ever Need
Tags: javascript, beginners
Published: 2023-02-07 09:57:27

This article was originally published on my personal website [here](https://dle.dev/blog/the-only-rounding-function-you-will-ever-need?utm_source=dev.to&utm_medium=the-only-rounding-function-you-will-ever-need). There's some other react/typescript related content there as well if you want to have a look.

We do have calls like `Math.round` or `Math.floor`, but those round to full numbers. The first rounds to a full number and the second simply rounds down. What do you do if you need to specify to how many decimal places, or specifically, to which step you want to round?. Well, look no further. I present **drumroll** _The Last Rounding Funciton You Will Ever need_

```javascript
function round(value, step) {
    step || (step = 1.0);
    const inv = 1.0 / step;
    return Math.round(value * inv) / inv;
}
```

courtesy of [Michael Deal](https://stackoverflow.com/a/34591063).

I supposed you could improve it by also employing [EPSILON](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON), but I find that this suffices for the time being.
Pandya Store Watch Online
Tags: desi, serial
Published: 2023-02-07 09:56:14

 The family show 'Pandya Store' featuring Kinshuk Mahajan, Gleaming Doshi, Kanwar Dhillon and Alice Kaushik, among others, is correct now zeroing in on the injury of Dhara (Sparkling) who lost Chiku, Shweta assuming control over the Pandya Store, and the hardships looked by Krish in getting the passing declaration from the store.

Presently, Dhara and Gautam (Kinshuk Mahajan) request Suman for the authority papers from their home and she surrenders the reports to them.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d740iczp8ezbvhz042y0.png)
[Pandya Store Watch Online
](https://pandyastoreserial.com/)
 Dhara tells her that they probably pained her a ton, as Suman gets close to home seeing her better half's image.

[Pandya Store Full Episode
](https://pandyastoreserial.com/)
Then again, a cop requests that Gautam give his dad's demise endorsement as they will require it in the methodology.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lo4e0eq019b4d086rkho.jpg)

 While everybody gets some information about the authentication, he admits that it is in the Pandya Store where he kept it behind the image of his dad.
Debounce Vs Throttle
Tags: javascript, beginners, typescript
Published: 2023-02-07 09:52:00

This article was originally published on my personal website [here](https://dle.dev/blog/debounce-vs-throttle?utm_source=dev.to&utm_medium=debounce-vs-throttle). There's some other react/typescript related content there as well if you want to have a look.

## 1. Overview

Every single time I'm calling a function a lot of times in quick succession I ask myself

> Wait... should I debounce call or throttle this call?

So for the sake of preserving my sanity (and maybe yours), I'll briefly explain what each function does and when to use
which.


## 2. Debounce

This function essentially cancels running calls until it hasn't been called for a set period of time. This makes it ideal for making sure that search query is only sent to the endpoint once the user is finished typing the query.

```typescript
function debounce(callback, delay = 500){
  let timeoutId;
  function debounced(...args){
    if(timeoutId){
      clearTimeout(timeoutId)
    }
    timeoutId = setTimeout(() => {
      callback(...args)
    }, delay)
  }
  return debounced
}
```

## 3. Throttle

Throttling a function call will reduce the number of times that function is called. It does that by setting a timeout
and only calling the last function once the timeout is complete. An implementation of throttle could look something like
this

```typescript
function throttle(callback, delay = 500) {
  var wait = false;

  function throttled(...args) {
    if (!wait) {
      callback(...args);
      wait = true;
      setTimeout(function () {
        wait = false;
      }, delay);
    }
  }
  
  return throttled
}

```

This snippet will cancel all calls which happen within the `delay`. Sometimes you'll want to que the last call. 

```typescript

function throttle(callback, delay = 500) {
  let shouldWait = false
  let quedArguments

  function quedCallback() {
    if (quedArguments == null) {
      shouldWait = false
    } else {
      callback(...quedArguments)
      quedArguments = null
      setTimeout(quedCallback, delay)
    }
  }


  function throttled(...args) {
    if (shouldWait) {
      quedArguments = args
      return
    }

    shouldWait = true
    setTimeout(quedCallback, delay)
  }

  return throttled
}

```

The major difference here is that we're saving the `...args` in the `quedArguments` variable and calling the `callback` with the last `quedArguments` contents.