Skip to content

Instantly share code, notes, and snippets.

@wjmazza
wjmazza / google-sheets-colour-preview.js
Last active April 19, 2024 06:15 — forked from Pathoschild/google-sheets-color-preview.js
A Google Sheets script which adds colour preview to cells. When you edit a cell containing a valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to that colour and the font colour will be changed to the inverse colour for readability.
/*
This script is meant to be used with a Google Sheets spreadsheet. When you edit a cell containing a
valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to
that colour and the font colour will be changed to the inverse colour for readability.
To use this script in a Google Sheets spreadsheet:
1. go to Tools » Script Editor » Spreadsheet;
2. erase everything in the text editor;
3. change the title to "Set colour preview on edit";
@gpaton
gpaton / private.xml
Last active May 24, 2023 17:33
Karabiner (KeyRemap4MacBook) remap "Play" OSX Key to launch Spotify
<?xml version="1.0"?>
<root>
<!-- Spotify Path -->
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_APP_Spotify</name>
<url type="file">/Applications/Spotify.app</url>
</vkopenurldef>
<!-- Set Spotify definition -->
<appdef>
<?php
add_filter( 'woocommerce_get_price_html', 'growdev_custom_price_message', 30, 2 );
/**
* Add string to
*
* @param $price HTML string
* @param $product WC_Product object
* @return string
*/
@albertbori
albertbori / Installation.md
Last active April 19, 2024 00:16
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
@corsonr
corsonr / gist:5933479
Created July 5, 2013 10:00
List WooCommerce products by tags
<?php
/**
* Plugin Name: WooCommerce - List Products by Tags
* Plugin URI: http://www.remicorson.com/list-woocommerce-products-by-tags/
* Description: List WooCommerce products by tags using a shortcode, ex: [woo_products_by_tags tags="shoes,socks"]
* Version: 1.0
* Author: Remi Corson
* Author URI: http://remicorson.com
* Requires at least: 3.5
* Tested up to: 3.5