Skip to content

Instantly share code, notes, and snippets.

@grappler
grappler / touchid_sudo.sh
Created Feb 21, 2021 — forked from RichardBronosky/touchid_sudo.sh
Use TouchID for sudo on modern MacBook Pro machines
View touchid_sudo.sh
#!/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(){
@grappler
grappler / comopser-wp-cli.md
Last active Nov 22, 2019 — forked from neverything/comopser-wp-cli.md
Install composer and wp-cli on cyon.ch hostings with SSH access.
View comopser-wp-cli.md

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 / woocommerce-show-products-ids.php
Created Sep 20, 2018 — forked from corsonr/gist:5947181
Show WooCommerce product ID in a custom column on products list page
View woocommerce-show-products-ids.php
<?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
View load-child-theme.php
<?php
/*
* Load parent theme translations
*/
add_action( 'after_setup_theme', 'woo_load_textdomain', 10 );
function woo_load_textdomain(){
$locale = get_locale();
$domain = 'woothemes';
View color.js
jQuery(document).ready(function($){
$('.meta-color').wpColorPicker();
});
View settings.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() {
@grappler
grappler / functions.php
Created Nov 18, 2012 — forked from isGabe/functions.php
Auto versioning of CSS/JS files in WordPress
View functions.php
/*
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
*/