Skip to content

Instantly share code, notes, and snippets.

@grappler
grappler / functions.php
Created November 18, 2012 19:44 — forked from isGabe/functions.php
Auto versioning of CSS/JS files in WordPress
/*
Auto-version CSS & JS files, allowing for cache busting when these files are changed.
Place in functions.php or wherever you are enqueueing your scripts & styles
Avoids using query strings which prevent proxy caching
Adjust paths based on your theme setup. These paths work with Bones theme
*/
@grappler
grappler / settings.php
Last active December 19, 2015 03:39 — forked from kovshenin/plugin.php
<?php
/**
* Plugin Name: My Plugin
* Plugin Description: Settings API Demo
* Text Domain: my-plugin
*/
add_action( 'admin_menu', 'my_admin_menu' );
function my_admin_menu() {
jQuery(document).ready(function($){
$('.meta-color').wpColorPicker();
});
<?php
/*
* Load parent theme translations
*/
add_action( 'after_setup_theme', 'woo_load_textdomain', 10 );
function woo_load_textdomain(){
$locale = get_locale();
$domain = 'woothemes';
@grappler
grappler / woocommerce-show-products-ids.php
Created September 20, 2018 08:36 — forked from corsonr/gist:5947181
Show WooCommerce product ID in a custom column on products list page
<?php
/**
* Plugin Name: WooCommerce - Show products IDs
* Plugin URI: http://www.remicorson.com/easily-find-woocommerce-products-id/
* Description: Adds a new columns to products list page to display product IDs
* Version: 1.0
* Author: Remi Corson
* Author URI: http://remicorson.com
* Requires at least: 3.5
* Tested up to: 3.5
@grappler
grappler / comopser-wp-cli.md
Last active November 22, 2019 08:55 — forked from neverything/comopser-wp-cli.md
Install composer and wp-cli on cyon.ch hostings with SSH access.

Cyon.ch/Hostpoint - Install composer & wp-cli

SSH into your server and stay in the home directory of the user. Check if you have a bin directory in your user directory already, in case you do, omit the mkdir bin.

Use bin folder in $HOME for user scriptsr

For the commands to be loaded from the bin directory run echo "export PATH=$HOME/bin:$PATH" >> ~/.bashrc. For the new config to be used run source ~/.bashrc or close and reopen your SSH session.

Composer

@grappler
grappler / touchid_sudo.sh
Created February 21, 2021 11:12 — forked from RichardBronosky/touchid_sudo.sh
Use TouchID for sudo on modern MacBook Pro machines
#!/bin/bash
# curl -sL https://gist.githubusercontent.com/RichardBronosky/31660eb4b0f0ba5e673b9bc3c9148a70/raw/touchid_sudo.sh | bash
# This script is ready to copy-paste in whole, or just the line above (without the leading #)
# Use TouchID for sudo on modern MacBook Pro machines
# This script adds a single line to the top of the PAM configuration for sudo
# See: https://apple.stackexchange.com/q/259093/41827 for more info.
touchid_sudo(){