Skip to content

Instantly share code, notes, and snippets.

View dr5hn's full-sized avatar
🪄
Turning ☕ into code | Full Stack Magician 🧙‍♂️✨

Darshan Gada dr5hn

🪄
Turning ☕ into code | Full Stack Magician 🧙‍♂️✨
View GitHub Profile
@prerna-p
prerna-p / mongodb_cheat_sheet.md
Created September 29, 2019 16:30 — forked from bradtraversy/mongodb_cheat_sheet.md
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@trey8611
trey8611 / import-optimizations.md
Last active November 29, 2024 11:06
WP All Import - Optimize your import speed.
@rmpel
rmpel / remove-sep.sql
Created May 15, 2018 08:40
Remove LSEP from database
update wp_posts SET post_title = REPLACE(post_title, UNHEX('e280a8'), '') WHERE post_title LIKE concat('%', UNHEX('e280a8'), '%');
update wp_posts SET post_content = REPLACE(post_content, UNHEX('e280a8'), '') WHERE post_content LIKE concat('%', UNHEX('e280a8'), '%');
@QWp6t
QWp6t / BedrockMultisiteValetDriver.php
Last active January 3, 2025 07:46
Fix Laravel Valet when using WordPress subdirectory multisite + Bedrock
<?php
namespace Valet\Drivers\Custom;
class BedrockMultisiteValetDriver extends \Valet\Drivers\Specific\BedrockValetDriver
{
/**
* Determine if the incoming request is for a static file.
*
* @return string|false
@ideadude
ideadude / pmpro_checkout_level_custom_prorating_rules.php
Last active August 15, 2023 14:29
Override the default proration behavior in the PMPro Proration Add On
/*
1. Make sure PMPro and PMPro Proration are both active.
2. Edit the pmpro_checkout_level_custom_prorating_rules function below to your needs.
3. Then add this code into a custom plugin for your site.
*/
/**
* Swap in our custom prorating function.
*/
function init_custom_prorating_rules() {
/*
* Display the array in a formatted manner
* Skip the struggle reading the array unformatted.
* Usage: rPrint($arrayElement);
*/
function rPrint($arr) {
echo '<pre>';
print_r($arr);
echo '</pre>';
}
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 21, 2025 07:39
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@VladimirAlexiev
VladimirAlexiev / README.md
Created March 30, 2017 06:54
How to use Google Sheets to Manage Wikidata Coreferencing

How to use Google Sheets to Manage Wikidata Coreferencing

A previous post How to Add Museum IDs to Wikidata explained how to use SPARQL to find missing data on Wikidata (Getty Museum IDs), how to create such values (from museum webpage URLs) and how to format them properly for QuickStatements.

Here I explain how to use Google sheets to manage a more advanced task. The sheet AAT-Wikidata matches about 3k AAT concepts to Wikipedia, WordNet30 and BabelNet (it restored an old mapping to Wordnet, retrieved it from BabelNet, mapped to Wikipedia).

  • For each row, it uses the following Google sheet formula (column C) to query the Wikipedia API and get the corresponding Wikidata ID (wikibase_item); split on two lines for readability:
=ImportXml(concat("https://en.wikipedia.o
@ControlledChaos
ControlledChaos / README.md
Last active February 20, 2025 23:41
Change the default WordPress post name to News and replace the Dashicon.

Change Default Posts to News

WordPress Snippet

@strangerstudios
strangerstudios / pmpro-custom-prorating.php
Last active December 24, 2020 08:29
Custom Prorating for PMPro with Delayed Downgrades
<?php
/*
Plugin Name: PMPro Custom Prorating Code
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-custom-prorating/
Description: Custom Prorating Code and Other Code for PMPro
Version: .2
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/