Skip to content

Instantly share code, notes, and snippets.

@PurpleBooth
PurpleBooth / README-Template.md
Last active August 18, 2025 10:39
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@purzlbaum
purzlbaum / customizer.php
Last active March 17, 2024 20:37
Google Font select for WordPress Customizer
<?php
new theme_customizer();
class theme_customizer {
public function __construct() {
add_action( 'customize_register', array(&$this, 'customize_linje' ));
}
/**
* Customizer manager demo
@ccstone
ccstone / References For Learning & Using Applescript.md
Last active August 10, 2025 06:24
References For Learning & Using Applescript

REFERENCES FOR LEARNING & USING APPLESCRIPT Modified: 2018/06/19 18:47


NOTES

AppleScript is a rather peculiar scripting language to learn.

@woogist
woogist / functions.php
Created June 16, 2015 07:47
Autocomplete all WooCommerce orders
/**
* Auto Complete all WooCommerce orders.
*/
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}
$order = wc_get_order( $order_id );
@joshfeck
joshfeck / simple_events.php
Last active October 12, 2021 23:39
simple EE4 event list query and display
<?php
// set up show expired = false
$where = array(
'Datetime.DTT_EVT_end' => array( '>=', current_time( 'mysql' )),
'status' => 'publish',
);
// run the query
if ( class_exists( 'EE_Registry' ) ) :
$events = EE_Registry::instance()->load_model( 'Event' )->get_all( array(
$where,
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active August 19, 2025 05:43
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@lorenzocaum
lorenzocaum / new_gist_file.md
Last active July 22, 2019 00:10
An overview of how the sample templates for Event Espresso 4 work together

This is an addendum to the steps for setting up sample templates tutorial for Event Espresso 4:

https://gist.github.com/lorenzocaum/16aac08f099d7c154f04

In this article, we'll go over how different templates work together. Afterwards, you should feel comfortable with locating the template file(s) that you need to edit to make a customization to an events page or venues page in Event Espresso 4.

Sample templates for Event Espresso 4 are available here:

/wp-content/plugins/event-espresso-core-reg/public/Espresso_Arabica_2014

@mclarke47
mclarke47 / reddit unsave hack
Last active December 20, 2023 01:45
a complete hack to click the unsave buttons on all reddit posts on screen.
Doesn't seem to work anymore
$("a").filter(function(index){return $(this).text()==="unsave"}).click();
New
document.querySelectorAll("a").forEach(function(index,other){if(index.text==="unsave"){index.click();}});
@rarylson
rarylson / automator_new_file.scpt
Last active July 31, 2025 02:02
AppleScript to create a new file in Finder (to be used in Automator)
-- AppleScript to create a new file in Finder
--
-- Use it in Automator, with the following configuration:
-- - Service receives: no input
-- - In: Finder.app
--
-- References:
-- - http://apple.stackexchange.com/a/129702
-- - http://stackoverflow.com/a/6125252/2530295
-- - http://www.russellbeattie.com/blog/fun-with-the-os-x-finder-and-applescript
@bekarice
bekarice / wc-sku-sorting.php
Last active April 8, 2024 17:56
Sort WooCommerce Products by SKU
<?php // ONLY COPY THIS LINE IF NEEDED!
/**
* Adds the ability to sort products in the shop based on the SKU
* Can be combined with tips here to display the SKU on the shop page: https://www.skyverge.com/blog/add-information-to-woocommerce-shop-page/
*
* @param array $args the sorting args
* @return array updated args
*/
function sv_add_sku_sorting( $args ) {