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
@jakebellacera
jakebellacera / ICS.php
Last active October 11, 2024 10:58
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@jonathonbyrdziak
jonathonbyrdziak / cron.class.php
Created April 3, 2012 22:13
Wordpress Cron Job Class. Makes Cronning a snap!
<?php
/**
* @Author Anonymous
* @link http://www.redrokk.com
* @Package Wordpress
* @SubPackage RedRokk Library
* @copyright Copyright (C) 2011+ Redrokk Interactive Media
*
* @version 0.1
*/
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@sodastsai
sodastsai / converter.py
Created October 22, 2012 01:47
Convert CSV to PLIST
#!/usr/bin/env python3
import sys
import csv
import plistlib
import os
csv_file = sys.argv[1]
with open(csv_file, 'r', encoding='utf-8') as f:
result = list(csv.DictReader(f))
@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
*/
@ControlledChaos
ControlledChaos / README.md
Last active June 22, 2023 07:47
Change the default WordPress post name to News and replace the Dashicon.

Change Default Posts to News

WordPress Snippet

@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
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active November 17, 2024 07:52
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

/*
* 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>';
}
@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() {