Skip to content

Instantly share code, notes, and snippets.

View davemac's full-sized avatar

davemac davemac

View GitHub Profile
@lgladdy
lgladdy / gruntfile
Created May 13, 2014 08:07
This is the gruntfile that powers gladdy.co.uk. It's for the blog post here: http://www.gladdy.co.uk/blog/2014/04/13/using-uncss-and-grunt-uncss-with-wordpress/
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
sourceMap: true,
sourceMapIncludeSources: true,
sourceMapIn: 'js/app.coffee.js.map'
},
@ejntaylor
ejntaylor / Products per row
Last active April 11, 2018 12:58
Upsells / Related Product Product Quantity and Columns
http://docs.woothemes.com/document/change-number-of-products-per-row/
@jofralogo
jofralogo / responsivemixin-foundation5.scss
Last active January 1, 2016 00:39
Mixins for responsive properties for Foundation 5: Like a shorthand to play with media-queries.
/*
++ MIXIN: Zurb Foundation 5 Responsive CSS Property ++
Define any CSS property and their values for phone, tablet and desktop.
i.e.:
@include rprop(margin-top,10px,20px,30px);
@robynitp
robynitp / geocode_xml.php
Created November 19, 2013 04:10
Example of accessing the Google Geocoding API and getting results in XML Info here: https://developers.google.com/maps/documentation/geocoding/
<?php
/*
Example of accessing the Google Geocoding API and getting results in XML
Info here: https://developers.google.com/maps/documentation/geocoding/
*/
$base_url = 'http://maps.googleapis.com/maps/api/geocode/';
$format = 'xml'; // 'xml' or 'json'
$address = 'address='.urlencode('350 5th Avenue New York, NY'); // makes the text URL friendly, ie, 350+5th+Avenue+New+York%2C+NY
$url = $base_url.$format.'?'.$address.'&sensor=false'; // Google requires 'sensor=false' parameter
@BFTrick
BFTrick / gettext-filter.php
Last active August 18, 2022 18:53
Use the gettext WordPress filter to change any translatable string.
<?php
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Related Products' :
$translated_text = __( 'Check out these related products', 'woocommerce' );
@toolmantim
toolmantim / Makefile
Last active August 21, 2024 20:56
An example of using Make instead of Grunt for fast, simple and maintainable front-end asset compilation.
# A simple Makefile alternative to using Grunt for your static asset compilation
#
## Usage
#
# $ npm install
#
# And then you can run various commands:
#
# $ make # compile files that need compiling
# $ make clean all # remove target files and recompile from scratch
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 5, 2025 13:05
A badass list of frontend development resources I collected over time.
@ccstone
ccstone / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Last active March 25, 2025 18:03
BBEdit-TextWrangler Regular Expression Cheat-Sheet
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEdit / BBEdit-Lite / TextWrangler Regular Expression Guide Modified: 2018/08/10 01:19
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.
@mattbanks
mattbanks / Gruntfile.js
Last active June 13, 2019 12:09
Gruntfile.js for use in developing and deploying WordPress themes
'use strict';
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
// watch for changes and trigger compass, jshint, uglify and livereload
watch: {
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }