Skip to content

Instantly share code, notes, and snippets.

Avatar

Miguel Garrido teledirigido

View GitHub Profile
@teledirigido
teledirigido / functions.php
Last active Apr 19, 2020 — forked from Willem-Siebe/functions.php
Replace the 'x' in WooCommerce cart.php with text because 'x' is not helpfull at all for screenreader users. I give a extra class to the text so that it can be hidden with CSS for visual browsers, because I replace that link with Font Awesome icon using :before. See also: https://github.com/woothemes/woocommerce/issues/5725.
View functions.php
// Replace the 'x' in WooCommerce cart.php with text because 'x' is not helpfull at all for screenreader users.
// https://gist.github.com/teledirigido/a859a1f0b954fc3f20cf44ef11d5718e/edit
function woocommerce_remove_item( $html, $cart_item_key ) {
$cart_item_key = $cart_item_key;
$html = sprintf( '<a href="%s" class="remove" title="%s"><span class="wsis-remove-item">%s</span></a>',
esc_url( wc_get_cart_remove_url( $cart_item_key ) ),
__( 'Remove', 'woocommerce' ),
__( 'Remove', 'woocommerce' ));
return $html;
}
@teledirigido
teledirigido / gruntfile.js
Last active Mar 23, 2016
Grunt file configuration example
View gruntfile.js
/*
GRUNTFILE JS WORKING EXAMPLE
----------------------------
- Babel
- Uglify
- Browser Sync
- Sass
- Watch
View fontloader.js
/*
Webfontloader
-------------
Based on: https://github.com/typekit/webfontloader#typekit
DESCRIPTION
-----------
@teledirigido
teledirigido / animate_svg.js
Last active Aug 29, 2015
Animate SVG with javascript
View animate_svg.js
/*
USAGE:
var svg = new animate_svg({
id: '#svg-logo',
frames: 100
});
svg.init();
View cs_select.scss
/*
*
* NOTE: There're some css3 features using @include and I'm not including (dumb I know).
* You can find all the css3 properties in here:
* https://gist.github.com/teledirigido/e7d346cc05b4d95b8c97
*
* This file has been created to work with the following script:
* https://gist.github.com/teledirigido/fec00d9e9ae3ac46b79c (cs_select.js)
*
*
@teledirigido
teledirigido / import_files.php
Created Jul 6, 2015
Create post, add attachment and update field via ACF
View import_files.php
<?php
/*
*
* This small scripts creates a post and attaches a file using Advanced custom field.
*
* Created by Miguel Garrido
* miguel.co.nz | miguel@blacksheepdesign.co.nz
*
* Notes:
View post_type_register.php
<?php
/**
* PARAMETERS
* ----------
*
*
* Required (Array)
*
@teledirigido
teledirigido / animation.js
Created May 25, 2015
Animate element with jQuery
View animation.js
/*
# Usage for your Javascript
$(document).ready(function(){
var animate_squared = new animation({
obj: '#your-tag .item',
});
@teledirigido
teledirigido / commands.sh
Last active Aug 29, 2015
Useful commands on shell
View commands.sh
# Find .htaccess and do chmod
sudo find / -type f -name '.htaccess' -exec chmod 604 {} \;
# Find wp-config.php and do chmod
sudo find / -type f -name 'wp-config.php' -exec chmod 644 {} \;
@teledirigido
teledirigido / .bash_profile
Last active Aug 29, 2015
Useful alias for your bash_profile
View .bash_profile
# Open your bashprofile
alias openbash="subl ~/.bash_profile";
# Thanks to jamie@blacksheepdesign.co.nz
alias showFiles="defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app";
alias hideFiles="defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app";