Skip to content

Instantly share code, notes, and snippets.

View otvoslaszlogabriel's full-sized avatar

Otvos Laszlo Gabriel otvoslaszlogabriel

  • 20:34 (UTC +03:00)
View GitHub Profile
@frozenex
frozenex / bulk-convert.ps1
Last active January 14, 2024 02:04
Bulk convert images to webp format using cwebp library in windows
# Copy this file to any directory containing images & then run this script in powershell
# Get all png images in the current directory & convert it to webp format
$images = Get-ChildItem -Path (Get-Location) -Filter *.png
foreach ($image in $images) {
$fileName = $image.DirectoryName + "\" + $image.BaseName + ".webp"
cwebp.exe -q 80 $image.FullName -o $fileName
}
@lukecav
lukecav / functions.php
Created November 4, 2016 18:42
Replace the default WordPress jQuery with Google Library hosted version
add_action( ‘wp_enqueue_scripts’, ‘register_jquery’ );
function register_jquery() {
if (!is_admin()) {
wp_deregister_script(‘jquery-core’);
wp_register_script(‘jquery-core’, ‘https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js’, true, ‘1.11.3’);
wp_enqueue_script(‘jquery-core’);
wp_deregister_script(‘jquery-migrate’);
wp_register_script(‘jquery-migrate’, ‘http://cdn.yourdomain.com/wp-includes/js/jquery/jquery-migrate.min.js’, true, ‘1.2.1’);
wp_enqueue_script(‘jquery-migrate’);
}