Shorts Archive - DevMaverick https://devmaverick.com/short/ Building robust web solutions Tue, 14 Oct 2025 14:38:23 +0000 en-US hourly 1 https://devmaverick.com/wp-content/uploads/2017/05/cropped-logo-small-full-thick-border-square-gold-150x150.png Shorts Archive - DevMaverick https://devmaverick.com/short/ 32 32 Autoplay video element https://devmaverick.com/short/autoplay-video-element/ https://devmaverick.com/short/autoplay-video-element/#respond Tue, 14 Oct 2025 14:38:23 +0000 https://devmaverick.com/?post_type=short&p=7712 Autoplay video element that works fine on iPhone as well.

The post Autoplay video element appeared first on DevMaverick.

]]>
Autoplay video element that works fine on iPhone as well.

<video poster="video-poster.png" autoplay playsinline loop muted>
    <source src="proxy.php?url=video.mp4" type="video/mp4" />
    Your browser does not support the video tag.
</video>

The post Autoplay video element appeared first on DevMaverick.

]]>
https://devmaverick.com/short/autoplay-video-element/feed/ 0
Grafana Docker Compose https://devmaverick.com/short/grafana-docker-compose/ https://devmaverick.com/short/grafana-docker-compose/#respond Mon, 27 May 2024 13:55:15 +0000 https://devmaverick.com/?post_type=short&p=7385 Here is an example of a Grafana Docker Compose file that you can use to quickly deploy a Grafana instance.

The post Grafana Docker Compose appeared first on DevMaverick.

]]>
Here is an example of a Grafana Docker Compose file that you can use to quickly deploy a Grafana instance.

---
#
# default login: admin admin
#
services:
  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    restart: always
    user: '0'
    ports:
      - 3999:3000
    volumes:
      - CHANGE_TO_COMPOSE_DATA_PATH/grafana:/var/lib/grafana
    networks:
      - grafana
networks:
  grafana:
    name: grafana
    driver: bridge

The post Grafana Docker Compose appeared first on DevMaverick.

]]>
https://devmaverick.com/short/grafana-docker-compose/feed/ 0
Remove file from repo via .gitignore after commit https://devmaverick.com/short/remove-file-from-repo-via-gitignore-after-commit/ https://devmaverick.com/short/remove-file-from-repo-via-gitignore-after-commit/#respond Fri, 26 Apr 2024 15:16:52 +0000 https://devmaverick.com/?post_type=short&p=7307 You committed some files to the repo and after that, you added them to the .gitignore file, but they are not being removed from the repo. You’ll have to use git […]

The post Remove file from repo via .gitignore after commit appeared first on DevMaverick.

]]>
You committed some files to the repo and after that, you added them to the .gitignore file, but they are not being removed from the repo.

You’ll have to use git rm –cached to remove the files

git rm --cached name-of-the-file

If you want to remove a whole folder use -r for recursive

git rm --cached -r folder-name

Source

The post Remove file from repo via .gitignore after commit appeared first on DevMaverick.

]]>
https://devmaverick.com/short/remove-file-from-repo-via-gitignore-after-commit/feed/ 0
Rename WordPress Custom Taxonomy https://devmaverick.com/short/rename-wordpress-custom-taxonomy/ https://devmaverick.com/short/rename-wordpress-custom-taxonomy/#respond Tue, 23 Apr 2024 14:35:50 +0000 https://devmaverick.com/?post_type=short&p=7306 You can rename your WordPress Custom Taxonomy using the SQL script below. Make sure you have a backup before. Go to Settings > Permalinks and hit “Update” one more time. You’re […]

The post Rename WordPress Custom Taxonomy appeared first on DevMaverick.

]]>
You can rename your WordPress Custom Taxonomy using the SQL script below. Make sure you have a backup before.

UPDATE  `wp_term_taxonomy` 
	SET  `taxonomy` =  'new_taxonomy' WHERE  `taxonomy` = 'old_taxonomy';

Go to Settings > Permalinks and hit “Update” one more time.

You’re all set.

The post Rename WordPress Custom Taxonomy appeared first on DevMaverick.

]]>
https://devmaverick.com/short/rename-wordpress-custom-taxonomy/feed/ 0
List template pages that are not used in WordPress theme https://devmaverick.com/short/list-template-pages-that-are-not-used-in-wordpress-theme/ https://devmaverick.com/short/list-template-pages-that-are-not-used-in-wordpress-theme/#respond Tue, 09 Apr 2024 10:22:55 +0000 https://devmaverick.com/?post_type=short&p=7303 The code below will list the names of the PHP template files not used on your website that still exist in your WordPress theme. This might be a good way to […]

The post List template pages that are not used in WordPress theme appeared first on DevMaverick.

]]>
The code below will list the names of the PHP template files not used on your website that still exist in your WordPress theme.

This might be a good way to find out what it’s extra when you’re refactoring or dealing with an old project that needs a revamp.

<?php 
    $templates = wp_get_theme()->get_page_templates();
    $template_list = [];

    foreach ($templates as $key => $template) {
        $template_list[] = $key;
    }

    $args = array(
        'post_type' => 'page',
        'posts_per_page' => -1
    ); 

    $the_query = new WP_Query( $args );
    $pages = $the_query->query($args);
    $used_templates_list = [];
    
    foreach ($pages as $key => $page) {
        $used_templates_list[] = get_page_template_slug($page->ID);
    }

    $used_templates_list = array_filter($used_templates_list);
    $unused_templates = array_diff($template_list, $used_templates_list);

    echo '<pre>';
    print_r($unused_templates);
    echo '</pre>';
?>

The post List template pages that are not used in WordPress theme appeared first on DevMaverick.

]]>
https://devmaverick.com/short/list-template-pages-that-are-not-used-in-wordpress-theme/feed/ 0
CSS Zig-Zag line https://devmaverick.com/short/css-zig-zag-line/ https://devmaverick.com/short/css-zig-zag-line/#respond Tue, 31 Oct 2023 12:14:28 +0000 https://devmaverick.com/?post_type=short&p=7193 Use the CSS code below to create a zig-zag line that can be used as a border. This is the Zig Zag line that will result from using the CSS code […]

The post CSS Zig-Zag line appeared first on DevMaverick.

]]>
Use the CSS code below to create a zig-zag line that can be used as a border.

.element::before {
    height: 29px;
    width: 55px;
    background: linear-gradient(135deg, white 35%, transparent 25%) -25px 0, linear-gradient(225deg, white 35%, transparent 25%) -25px 0, linear-gradient(315deg, white 35%, transparent 25%), linear-gradient(45deg, white 35%, transparent 25%);
    background-color: #ffcc00;
    display: block;
    content: "";
    background-size: 16px 31px;
    background-repeat: repeat-x;
}


Zig Zag line made with CSS

This is the Zig Zag line that will result from using the CSS code above on the .element class.

The post CSS Zig-Zag line appeared first on DevMaverick.

]]>
https://devmaverick.com/short/css-zig-zag-line/feed/ 0
Laravel Migration make existing column nullable https://devmaverick.com/short/laravel-migration-make-existing-column-nullable/ https://devmaverick.com/short/laravel-migration-make-existing-column-nullable/#respond Sun, 29 Oct 2023 18:02:41 +0000 https://devmaverick.com/?post_type=short&p=7192 Create a new migration In the new file add this to the function up(): Make sure you install doctrine/dbal because it’s required for this. Now you can run your migrations.

The post Laravel Migration make existing column nullable appeared first on DevMaverick.

]]>
Create a new migration

php artisan make:migration change_description_products_table

In the new file add this to the function up():

Schema::table('your_table_name', function (Blueprint $table) {
    $table->text('your_field_name')->nullable()->change();
});

Make sure you install doctrine/dbal because it’s required for this.

composer require doctrine/dbal

Now you can run your migrations.

The post Laravel Migration make existing column nullable appeared first on DevMaverick.

]]>
https://devmaverick.com/short/laravel-migration-make-existing-column-nullable/feed/ 0
Import MySQL DB gzipped https://devmaverick.com/short/import-mysql-db-gzipped/ https://devmaverick.com/short/import-mysql-db-gzipped/#respond Thu, 30 Mar 2023 11:53:26 +0000 https://devmaverick.com/?post_type=short&p=7054 If you also want a progress bar in the terminal,  install pv. Import with pv

The post Import MySQL DB gzipped appeared first on DevMaverick.

]]>

zcat /path/to/file.sql.gz | mysql -u 'root' -p database_name

If you also want a progress bar in the terminal,  install pv.

Import with pv

pv /path/to/file.sql.gz | gunzip | mysql -u 'root' -p database_name

The post Import MySQL DB gzipped appeared first on DevMaverick.

]]>
https://devmaverick.com/short/import-mysql-db-gzipped/feed/ 0
Responsive circle progress SVG https://devmaverick.com/short/responsive-circle-progress-svg/ https://devmaverick.com/short/responsive-circle-progress-svg/#respond Thu, 17 Nov 2022 14:29:33 +0000 https://devmaverick.com/?post_type=short&p=6957 Replace the stroke-dasharray value in the SVG with the percent progress out of 100. Currently set to 60. You can do it dynamically with JS.  

The post Responsive circle progress SVG appeared first on DevMaverick.

]]>
Replace the stroke-dasharray value in the SVG with the percent progress out of 100. Currently set to 60.

You can do it dynamically with JS.

<svg viewBox="0 0 36 36" class="circular-chart">
    <path class="circle" style="stroke: #28fa65;"
        stroke-dasharray="60, 100"
        d="M18 2.0845
        a 15.9155 15.9155 0 0 1 0 31.831
        a 15.9155 15.9155 0 0 1 0 -31.831"
    />
</svg>

.circular-chart {
    display: block;
    margin: auto;
    width: 100%;
    height: 100%;
    }
    
    .circle {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    animation: progress 1s ease-out forwards;
    }
    
    @keyframes progress {
    0% {
        stroke-dasharray: 0 100;
    }
}

 

The post Responsive circle progress SVG appeared first on DevMaverick.

]]>
https://devmaverick.com/short/responsive-circle-progress-svg/feed/ 0