Skip to content

Instantly share code, notes, and snippets.

@Sanabria
Sanabria / unbrew.rb
Created February 21, 2016 23:20 — forked from SteveBenner/unbrew.rb
Homebrew uninstall script
#!/usr/bin/env ruby
#
# CLI tool for locating and removing a Homebrew installation
# http://brew.sh/
#
# Copyright (C) 2014 Stephen C. Benner
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@Sanabria
Sanabria / product-tag-list-for-woocommerce.php
Created October 17, 2015 04:20
Product Tag List Widget for WooCommerce by Webbgaraget.
<?php
/**
* Plugin Name: Product Tag List Widget
* Plugin URI:
* Description: A sidebar Widget for displaying the product tags in a list.
* Version: 1.0
* Author: Webbgaraget
* Author URI: http://www.webbgaraget.se
* Tags: plugin, product, tag, list, widget
* License: GPL
@Sanabria
Sanabria / gist:3a1b76c148afbf2830e9
Last active August 29, 2015 14:25 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# First:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
#go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@Sanabria
Sanabria / last-word.js
Last active August 29, 2015 14:12 — forked from ramseyp/last-word.js
jQuery(document).ready(function($){
$('h2.title').html(function(){
// separate the text by spaces
var text= $(this).text().split(' ');
// drop the last word and store it in a variable
var last = text.pop();
// join the text back and if it has more than 1 word add the span tag
// to the last word
return text.join(" ") + (text.length > 0 ? ' <span class="last">'+last+'</span>' : last);

This post outlines a way to use Sass, Compass, and Grunt to maintain stylesheets for a WordPress parent and child theme.

Sass is useful for many reasons, but for our purposes, the two most helpful features are partials and variables. We'll also take advantage of the importPath setting of Compass and Grunt.

Comments and improvements are always welcome.

Step 1: Create your parent stylesheet

Create a new Compass project in your theme and style away. When you're finished, your theme directory (called parent here) might look something like this:

<?php
$args = array(
'post_type' => 'slides',
'posts_per_page' => 999
);
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query($args);
if($wp_query->have_posts()) : ?>
<div id="featured">