Skip to content

Instantly share code, notes, and snippets.

View dragonlord4747's full-sized avatar

Gian Khách dragonlord4747

View GitHub Profile
@josemmo
josemmo / repair-mysql-data.ps1
Created August 28, 2020 18:48
Repair MySQL data directory (for XAMPP)
# Based on this answer: https://stackoverflow.com/a/61859561/1956278
# Backup old data
Rename-Item -Path "./data" -NewName "./data_old"
# Create new data directory
Copy-Item -Path "./backup" -Destination "./data" -Recurse
Remove-Item "./data/test" -Recurse
$dbPaths = Get-ChildItem -Path "./data_old" -Exclude ('mysql', 'performance_schema', 'phpmyadmin') -Recurse -Directory
Copy-Item -Path $dbPaths.FullName -Destination "./data" -Recurse
@igorbenic
igorbenic / admin.css
Last active April 2, 2020 03:49
How to Create a Sortable WordPress Gallery | http://www.ibenic.com/create-sortable-wordpress-gallery/
.sortable_wordpress_gallery li.attachment {
width: 141px;
height: 141px;
}
.sortable_wordpress_gallery {
display: block;
}
.sortable_wordpress_gallery:after {
display: table;
content: '';
@dannyconnolly
dannyconnolly / translate_woocommerce.php
Created December 18, 2015 13:22
Change SKU text label in woocommerce to Product Code
function translate_woocommerce($translation, $text, $domain) {
if ($domain == 'woocommerce') {
switch ($text) {
case 'SKU':
$translation = 'Product Code';
break;
case 'SKU:':
$translation = 'Product Code:';
break;